I am trying to run my Python script as a system service. For this I have installed all necessary libraries in a virtualenv and have created the following service in /usr/lib/systemd/system:
[Unit]
Description=Desc
After=network.target
[Service]
Type=simple
User=<my-user>
Restart=on-abort
WorkingDirectory=/home/<my-user>
ExecStart=/home/<my-user>/.virtualenvs/myvenv/bin/python /home/<my-user>/workspacePython/test.py
Environment="PATH=/home/<my-user>/.virtualenvs/myvenv/bin"
[Install]
WantedBy=multi-user.target
But when I try to run it, it fails with:
Okt 07 20:45:49 fedora systemd[40808]: test.service: Failed at step EXEC spawning /home/<my-user>/.virtualenvs/myvenv/bin/python: Permission denied
The access rights for the python binary are rather permissive (777), so I am a bit confused how this comes about.
My Question is: How do I get to start the script within the virtualenv with systemd?