Page 1 of 1

Question about running programs when Pi starts up

Posted: Sun May 11, 2014 10:28 pm
by Stille
Hi,
I need to run 3 programs at the same time when Rasp Pi starts up, and those 3 programs will keep running (forever, :D). How could I do that?

Someone told me I could write some script in the "rc.local " to run programs when starting up, but that seems to run programs one by one (start another program when one program ends).

Could anyone give me any suggestions?
Thank you!

Re: Question about running programs when Pi starts up

Posted: Sun May 11, 2014 10:30 pm
by joan
Put an & at the end of each command you want to run.

Re: Question about running programs when Pi starts up

Posted: Mon May 12, 2014 11:40 am
by sav25
Not sure if it works for multiple programs - but I use cron to run a script on boot. RaspberryPiSpy has a good guide:

http://www.raspberrypi-spy.co.uk/2013/0 ... sing-cron/

Re: Question about running programs when Pi starts up

Posted: Mon May 12, 2014 1:03 pm
by hampi
Daemon coding is not that difficult though needs some care and most of all comprehensible log files.

Re: Question about running programs when Pi starts up

Posted: Mon May 12, 2014 1:19 pm
by Richard-TX
To have programs (python or /bin/sh) run at boot and stay running is sort of an art form.

adding the line

nohup /path/to/command 2>&1 > /tmp/programlog &

works in most cases. If it fails to start and run, most issues will be recorded in the logfile.