Hi all,
How do I setup a program to automatically run when the Raspberry Pi is startup and reboot? Specifically I want the BOINC program to automatically run at startup and reboot. Regards, waltd
Start a program at startup
5 posts
- Posts: 27
- Joined: Mon Feb 18, 2013 12:58 pm
At least a couple of different ways
1. crontab
- @reboot time in crontab will run it at boot time
2. modify init scripts
- adding a file in /etc/init.d/ and then using update-rc.d to start it at default run levels
1. crontab
- @reboot time in crontab will run it at boot time
2. modify init scripts
- adding a file in /etc/init.d/ and then using update-rc.d to start it at default run levels
My Blog - http://www.sirlagz.net
Visit my blog for ffmpeg Webcam streaming, Raspbian Server Edition, RaspAP Hotspot guides and more !
Home of PiParted - A custom GParted LiveCD to make installing OSes onto the SD Card easier !!
Visit my blog for ffmpeg Webcam streaming, Raspbian Server Edition, RaspAP Hotspot guides and more !
Home of PiParted - A custom GParted LiveCD to make installing OSes onto the SD Card easier !!
- Posts: 984
- Joined: Mon Feb 20, 2012 8:53 am
- Location: Perth, Australia
You may find it helpful to control the program you're starting if you put its invocation in a shell script. That way the shell script can set environment variables, change directories, etc. just before starting the program. Then either make the shell script executable or in crontab or wherever start it with "sh -c yourscript". I prefer using sh -c. The linux sites should have documentation and examples on how to add startup stuff with init.d and crontab.
- Posts: 37
- Joined: Thu Feb 28, 2013 6:07 am
Thank you.
- Posts: 27
- Joined: Mon Feb 18, 2013 12:58 pm
waltd wrote:Hi all,
How do I setup a program to automatically run when the Raspberry Pi is startup and reboot? Specifically I want the BOINC program to automatically run at startup and reboot. Regards, waltd
If you are installing BOINC from the Raspbian repo (minimum is package "boinc-client" ) , then it actually runs as a daemon under a user "boinc" and is started / stopped automatically when the system boots/shuts down. All out of the box.
Cheers
HBE
- Posts: 29
- Joined: Sun Nov 04, 2012 9:03 pm
- Location: near Hannover, Germany