Running bottle web server through systemd?

I am trying to run a bottle app that I wrote using systemd. I made a /etc/systemd/user/bottle.service file with the following contents:

 [Unit] Description=Bottled fax service After=syslog.target [Service] Type=simple User=fax Group=fax WorkingDirectory=/home/fax/bottlefax/ ExecStart=/usr/bin/env python3 server.py StandardOutput=syslog StandardError=syslog Restart=always RestartSec=2 [Install] WantedBy=bottle.target 

However, when I try to run it, it fails, and this prints in journalctl :

 Jun 10 17:33:31 nano systemd[1]: Started Bottled fax service. Jun 10 17:33:31 nano systemd[1]: Starting Bottled fax service... Jun 10 17:33:31 nano systemd[2380]: Failed at step GROUP spawning /usr/bin/env: No such process Jun 10 17:33:31 nano systemd[1]: bottle.service: main process exited, code=exited, status=216/GROUP Jun 10 17:33:31 nano systemd[1]: Unit bottle.service entered failed state. Jun 10 17:33:31 nano systemd[1]: bottle.service failed. 

How do I fix this?

Edit:

Going to /usr/bin/python3 , as others suggested results with the same error (modified file):

 Jun 10 18:43:48 nano systemd[1]: Started Bottled fax service. Jun 10 18:43:48 nano systemd[1]: Starting Bottled fax service... Jun 10 18:43:48 nano systemd[2579]: Failed at step GROUP spawning /usr/bin/python3: No such process Jun 10 18:43:48 nano systemd[1]: bottle.service: main process exited, code=exited, status=216/GROUP Jun 10 18:43:48 nano systemd[1]: Unit bottle.service entered failed state. Jun 10 18:43:48 nano systemd[1]: bottle.service failed. 
+7
python bottle systemd
source share
2 answers

I would comment, but I can not: /

Have you tried something like an absolute path?

 ExecStart=/usr/bin/python3 /path/to/your/server.py 

This is the only problem I see here.

+3
source share

Another possible reason for this error is that you created a system user by running adduser --system and did not create a linked group.

0
source share