0

I have a raspberry pi, and am settings it up to run TwoToneDetect. I have a .py file that boots it, and I can run it from the command line via /home/pi/TTD/boot.sh, but when I add that to the rc.local, nothing happens

  • I suspect that you will need to provide more detail, for this to be answered. Please edit question to tell us what worker. And what did not. Be precise. e.g How did you add it? What is in the script? – ctrl-alt-delor Jan 11 '20 at 10:22
0

Take all the commands you have at /home/pi/TTD/boot.sh and put them in rc.local In rc.local. Use the correct absolute full paths to your commands, & at the end of your command. There should already be an #!/bin/sh -e or similar shebang at the beginning of the file and exit 0 at the end. Leave them intact and put your commands in between.

/bin/TwoToneDetect &
...
exit 0

That's said. The recommendation nowadays is to use systemd instead and I quote from https://www.raspberrypi.org/documentation/linux/usage/rc-local.md

NOTE: on Jessie, Stretch and Buster (which use systemd), rc.local has drawbacks: not all programs will run reliably, because not all services may be available when rc.local runs. See systemd for another way to have a command or program run when Raspberry Pi boots.

  • Be sure to add your shebang at the beginning of rc.local too, or it may fail to run, which I suspect is happening. – Pheric Jan 11 '20 at 18:21

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.