I have a python script that I normally run it with this command:
(environment) python run.py
I want to run this script at start. (I'm using ubuntu) Here is my service:
[Unit] Description=My Script Service After=multi-user.target [Service] Type=idle ExecStart=/home/user/anaconda3/bin/python /home/user/space/run.py [Install] WantedBy=multi-user.target
BTW, I couldn't run this script, but I could run any script that is not inside environment. How can I run a python script at startup (virtualenv)?
sudo systemctl status user_sent ● user_sent.service - Mail Service Loaded: loaded (/lib/systemd/system/user_sent.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since xxxxx 16:30:20 MSK; 3s ago Process: 3713 ExecStart=/usr/bin/python run.py (code=exited, status=200/CHDIR) Main PID: 3713 (code=exited, status=200/CHDIR)