1

I want to run tunslip6 on bootup and so far I tried adding this line -

sudo ./tunslip6 -s /dev/ttyUSBx abcd::1/64 -v4

to crontab, accessed via terminal through sudo crontab -e

But tunslip doesn't open even though I power up the Pi with a USB device attached. And any subsequent processes I must do after this step and useless without tunslip. Is there anything I'm missing? What did I do wrong?

2

First of all test if you're able to make it work by issuing command manually on the terminal. Once it works fine. I would suggest adding it to /etc/rc.local to execute at start up just to make sure that network and everything is up by then. So, step by step.

  1. Make sure it works manually.

  2. Open rc.local by sudo nano /etc/rc.local

  3. Copy paste the same command that worked fine when testing manually before exit 0 line.

  4. reboot

It should work.

Points to remember.

  1. you won't be able to run ./tunslip6 if utility is not installed in /usr/bin. If you built it from source, make sure you ran "sudo make install"

  2. If you don't want to install utility, use full path to the utility while keeping it in rc.local

Possible reasons for not working as a cronjob,

  1. You didn't provide full path.

  2. cron syntax is wrong. (I'm doubtful about this as cron straight away rejects an edit which is having a syntax error)

Possible solution(s).

Try adding,

@reboot /path/to/tunslip6/tunslip6 -s /dev/ttyUSBx abcd::1/64 -v4 > /dev/null 2&>1

Hope it helps.

0

If you added this exact line, you're missing the fields telling cron when to run your command (and crontab -e should probably have refused to save that crontab). Since you want it to run on boot, you'll probably want to prepend @reboot to that command.

You can also remove the sudo, since you're adding the command to the root user's crontab anyway.

Finally, if your command requires network access, you should either have it started by something like systemd that's aware of the network requirement and can postpone running the command until the network is available, or put the command into a script that waits in a loop until the network is up (and run that instead of the plain command).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.