I have a daemon Python
script in my conda
environment which I run it:
source activate my_env
python my_server.py
I would like to convert it to as systemd
service, so I created my_server.service file:
[Service]
User=myuser
Group=myuser
Type=simple
ExecStart=/home/myuser/.conda/envs/my_env/bin/python /path/to/my_server.py
This does not work because the systemd
is being run as the root user and I can not activate the conda
environment to get the all path right.
What is the correct way to create a systemd
service when the executable requires a specific conda
env to run?