Skip to content

Instantly share code, notes, and snippets.

@shekharkoirala
Last active February 3, 2019 05:53
Show Gist options
  • Save shekharkoirala/df8e780a0785a3c6f01d3767a3a63bf4 to your computer and use it in GitHub Desktop.
Save shekharkoirala/df8e780a0785a3c6f01d3767a3a63bf4 to your computer and use it in GitHub Desktop.
Run python program as a service in linux
# path : sudo nano /lib/systemd/system/service_name.service
[Unit]
Description=Daemon Service
[Service]
Type=simple
ExecStart=/usr/bin/python3 /path/to/python/file/example.py
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment