Reputation: 795
I have a python script which I'd like to run every time my machine boots. It requires sudo however. What's a simple solution to make my python script with sudo on startup?
Upvotes: 1
Views: 2747
Reputation: 22930
You can use launchd
.
launchd -- System wide and per-user daemon/agent manager
Add your property list file to the /Library/LaunchDaemons
directory.
Have a look at Technical Note TN2083 Daemons and Agents
Upvotes: 0
Reputation: 795
For non-privileged startup scripts simply add your single line command to /etc/rc.local
for commands that require sudo
add it to /etc/rc.common
.
Upvotes: 1