2015-06-10 12 views
7

Sto provando ad avviare un'applicazione web per le bottiglie che ho scritto usando systemd. Ho fatto il file /etc/systemd/user/bottle.service con il seguente contenuto:Avvio del server Web della bottiglia tramite systemd?

[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 

Tuttavia, quando provo ad avviarlo, non riesce e questo viene stampato 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. 

Come devo risolvere questo problema?

Edit:

Passaggio a /usr/bin/python3 come altri hanno suggerito risultati nella stesso errore (file modificato però):

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. 
+0

Sei sicuro che '/ usr/bin/env' è quello che vuoi? Che ne dici di '/ usr/bin/python3'? – bbayles

risposta

3

avrei commentato ma non ci riesco:/

Hai provato qualcosa del genere con un percorso assoluto?

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

Questo è l'unico problema che posso vedere qui.

0

Un'altra possibile causa di questo errore è se è stato creato un utente di sistema eseguendo adduser --system e non è stato creato il gruppo associato.