Forked from ricferr/gist:90583f608f0b0ae9c3cf6833be04ab85
Created
February 2, 2021 10:56
-
-
Save ekapujiw2002/b0575a9448947925eb885d1aa7024aae to your computer and use it in GitHub Desktop.
How to create a systemd service for python script with virtualenv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Some description | |
After=network.target | |
[Service] | |
Type=simple | |
User=user | |
WorkingDirectory=/home/user/somedir | |
Environment=PYTHONPATH=/home/user/somedir | |
ExecStart=/home/user/venv/bin/python script.py | |
Restart=on-failure | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment