I'm new to VPS and I want to run a Python script forever. I followed instructions in this post but I'm missing something because it's not working
I made my botWooService.service
file in /etc/systemd/system/
. This is what it contains
[Unit]
Description=botWoo
After=syslog.target network.target
[Service]
Type=simple
User=root
WorkingDirectory=home/bots/botWoo/venv
ExecStart=home/bots/botWoo/venv/bin/python home/bots/botWoo/main.py --serve-in-foreground
Restart=on-abort
[Install]
WantedBy=multi-user.target
When I run systemctl start botWooService
I get:
Failed to start botWooService.service: Unit is not loaded properly: Invalid argument.
See system logs and 'systemctl status botWooService.service' for details.
I am not sure if it's not working properly because I am using Environment Variables and there is a .env
file in home/bots/botWoo/
or if the issue is due to something else.
When I run home/bots/botWoo/venv/bin/python -m site
this is the output
sys.path = [
'/',
'/usr/lib64/python36.zip',
'/usr/lib64/python3.6',
'/usr/lib64/python3.6/lib-dynload',
'/home/bots/botWoo/venv/lib64/python3.6/site-packages',
'/home/bots/botWoo/venv/lib/python3.6/site-packages',
]
USER_BASE: '/root/.local' (exists)
USER_SITE: '/root/.local/lib/python3.6/site-packages' (doesn't exist)
ENABLE_USER_SITE: False
And when I run python -m site
I get this:
sys.path = [
'/',
'/usr/lib64/python27.zip',
'/usr/lib64/python2.7',
'/usr/lib64/python2.7/plat-linux2',
'/usr/lib64/python2.7/lib-tk',
'/usr/lib64/python2.7/lib-old',
'/usr/lib64/python2.7/lib-dynload',
'/usr/lib64/python2.7/site-packages',
'/usr/lib64/python2.7/site-packages/gtk-2.0',
'/usr/lib/python2.7/site-packages',
]
USER_BASE: '/root/.local' (exists)
USER_SITE: '/root/.local/lib/python2.7/site-packages' (doesn't exist)
ENABLE_USER_SITE: True
So I am not getting the same output and I really don't know what this means. Hopefully someone can point me in the right direction. Thank you.