Saturday, 18 February 2017

Adding script to raspberry pi boot, startup, or initialization

At command to run your script at the end of /etc/rc.local.

Don't forget to return it with exit 0 at the end of script.

Blocking/long time taking scripts should be forked (with &)

python <absolute-path-to-my-script> &

The script /etc/rc.local is executed after all the normal system services are started or when all boot scripts have been executed.

rc means "run-control"

local is for all the local services/scripts you want to start.

2 comments: