Skip to content Skip to sidebar Skip to footer

Python Initiated With Systemd Cannot Start Subprocess

I have a python script inside a virtualenv which is started using systemd. [Unit] Description=app After=network.target [Service] Type=simple User=user Group=user Environment=VIRTU

Solution 1:

I'm not sure but it is very possible that setting environment in one configuration line isn't taken into account in the following ones.

Environment=VIRTUAL_ENV=/home/user/Projects/app/venv
Environment=PATH=$VIRTUAL_ENV/bin:$PATH

here you're expecting VIRTUAL_ENV to be set to $VIRTUAL_ENV is evaluated the next line, but that may not work. I would try hardcoding the second line:

Environment=VIRTUAL_ENV=/home/user/Projects/app/venv
Environment=PATH=/home/user/Projects/app/venv/bin:$PATH

Post a Comment for "Python Initiated With Systemd Cannot Start Subprocess"