rpiarduinomusings

Raspberry Pi, Arduino, Sensors and the data they produce

More Startup Processing – init.d & update-rc.d

While working on an implementation of the Raspberry Pi Camera module, we were looking to run the device remotely and headless.  We came across this knowledge in conjunction with implementing the pi-timolo code and found it useful for a variety of applications.

A good example for this is when you have written an application in python, and you want to have it execute automatically on startup.

  1. To auto launch the application, you’ll want to create a shell script.
  2. Once you have created this script, you’ll copy it to the init.d folder.
  3. check the permissions to be sure your user can execute the script:
    1. ls -la /etc/init.d/yourscript.sh
    2. cd /etc/init.d
    3. chmod +x yourscript.sh
  4. Now set it up to execute on boot:
    1. sudo update-rc.d yourscript.sh defaults

When you reboot after completing the steps above, the program should automatically start!

 

One response to “More Startup Processing – init.d & update-rc.d

  1. Pingback: Attaching a Samba Share at Startup / fstab | rpiarduinomusings

Leave a comment