Created
November 16, 2015 23:00
-
-
Save danechitoaie/f2bb03fd0c2d6b803878 to your computer and use it in GitHub Desktop.
Virtualenv Systemd Service
This file contains hidden or 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=Python Virtualenv service example | |
After=network.target | |
[Service] | |
User=my_user | |
Group=my_group | |
Environment=VIRTUAL_ENV=/home/my_user/.virtualenvs/my_venv | |
Environment=PATH=$VIRTUAL_ENV/bin:$PATH | |
ExecStart=$VIRTUAL_ENV/bin/my_entrypoint | |
Restart=always | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Systemd does not expand environment variables.
You end up with literal
$VIRTUAL_ENV
and$PATH
inside the PATH variableand in path to the executable.