1 1
chiehming

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

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.

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
1 1