mmocz
Posts: 2
Joined: Tue May 13, 2014 2:26 pm

Run shell script at boot

Tue May 13, 2014 2:29 pm

Hi,

I am trying to run a shell script /home/pi/mmal/startmotion at boot, but so far I had no success. What should I do so it runs at boot? rc.local? CRON? And how to do it?

Thanks a lot

User avatar
tedhale
Posts: 114
Joined: Thu Sep 20, 2012 4:52 pm
Location: Williamsburg, VA, USA
Contact: Website

Re: Run shell script at boot

Tue May 13, 2014 6:41 pm

/etc/rc.local is the usual place to do this. Be sure to run the script in the background (add a & to the end of the line) otherwise rc.local won't exit until your script completes and startup will hang. Of course, if that's the behavior you want, the leave off the &.
- Ted B. Hale
http://raspberrypihobbyist.blogspot.com

Return to “Troubleshooting”