Jump to content

How to run a python script at startup on orange pi zero?


chiehming

Recommended Posts

How about creating/editing /etc/rc.local and running script from there? i.e. Something like

#!/bin/bash

python <name of script> &

exit 0

 

Make sure that /etc/rc.local is executable (sudo chmod +x /etc/rc.local) and it'll be picked up and run when you reboot.

Link to comment
Share on other sites

On 6/13/2018 at 6:01 AM, pfeerick said:

How about creating/editing /etc/rc.local and running script from there? i.e. Something like


#!/bin/bash

python <name of script> &

exit 0

 

Make sure that /etc/rc.local is executable (sudo chmod +x /etc/rc.local) and it'll be picked up and run when you reboot.

 

One small thing to remember about the rc.local script: It *must* exit successfully. So the last line, as in the above script

exit 0

must be present and the last line. I just wanted to make sure one didn't remove it - it can be a gotcha!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines