Raspberry Pi Auto Start Boot Time

sudo nano /etc/rc.local

Add commands below the comment, but leave the line exit 0

If your command runs continuously (perhaps runs an infinite loop) or is likely not to exit, you must be sure to fork the process by adding an ampersand to the end of the command, like so:

python /home/pi/myscript.py &

or

sh /home/pi/myscript.sh &

NOTE: Doesn’t work on cold restart (power down and up)!

Alternative Method:

sudo nano /etc/init.d/myscript
sudo chmod 755 /etc/init.d/myscript

Note: init.d Scripting is complex!

sudo update-rc.d myscript defaults
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s