rc.local failed on Raspberry Pi3 - how do I get it to run a .py program on start up?



rocketsurgery4 months ago

Hey... I just set a python script (on my pi2) to run as a service using these instructions ... works really well and is a nice way of starting/stopping your script. Instructions are for a Wheezy install but with a few tweaks will work for Jessie.

Normally to run a program on startup you need to edit /etc/rc.local as root, so do:

sudo nano /etc/rc.local

Add your script/program after the comment but before the 'exit 0', if necessary you can make your program run as a process by adding an ampersand '&' to the end of the command.

If for some reason you're having strange problems, or like you say your rc.local has failed, just re-image your MicroSD card with a fresh working image Raspbian or Noobs and try again.

iceng4 months ago

Hard to help a blank slate.

What are your skills ?