I just got a debian 8 VPS and I'm trying to run a python script as a service, I wrote this (everithing was done via ssh logged as root) :
[Unit]
Description=My Script Service
After=multi-user.target
[Service]
Type=idle
ExecStart=/usr/bin/python /web/cmcreader/test.py > /web/cmcreader/test.log 2>&1
[Install]
WantedBy=multi-user.target
I've put it in /lib/systemd/system
I then chmoded it :
chmod 644 /lib/systemd/system/cmcreader.service
I then tried to activate it using :
systemctl daemon-reload
systemctl enable cmcreader.service
however the last command returns (enable
) :
Failed to execute operation: Invalid argument
What did I do wrong? Thanks.