Skip to content

Instantly share code, notes, and snippets.

@suryadana
Created May 26, 2018 03:55
Show Gist options
  • Save suryadana/847718dece1634aeafe9f887cb1664ff to your computer and use it in GitHub Desktop.
Save suryadana/847718dece1634aeafe9f887cb1664ff to your computer and use it in GitHub Desktop.
Run your script with systemd on linux
# Copy to /etc/systemd/system/ this script and change ExecStart value.
After=syslog.target network.target
[Service]
ExecStart=/usr/bin/python /path/of/script/main.py
Restart=on-abort
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment