2017-02-13 3 views
1

Voici mon fichier de service:systemctl d'erreur étrange: Les arguments non valides

[Unit] 
Description=Daphne Interface 

[Service] 
ExecStartPre=cd /home/git/hsfzmun/server 
ExecStart=/bin/bash/ -c "cd /home/git/hsfzmun/server && /home/git/virtualenvs/hsfzmun/bin/daphne -b 0.0.0.0 -p 8001 -v2 config.asgi:channel_layer" 
Restart=always 
KillSignal=SIGQUIT 
Type=notify 
NotifyAccess=all 

[Install] 
WantedBy=multi-user.target 

Quand j'exécute sudo systemctl start daphnei je reçois:

Failed to start daphnei.service: Unit daphnei.service is not loaded properly: Invalid argument. 
See system logs and 'systemctl status daphnei.service' for details. 

Et le résultat de systemctl status daphnei.service:

* daphnei.service - Daphne Interface 
    Loaded: error (Reason: Invalid argument) 
    Active: inactive (dead) (Result: exit-code) since Mon 2017-02-13 19:55:10 CST; 13min ago 
Main PID: 16667 (code=exited, status=1/FAILURE) 

Quel est le problème ? J'utilise Ubuntu Server 16.04.

Répondre

0

Peut-être que vous avez pensé à elle maintenant, mais il y a un / supplémentaire après /bin/bash dans votre ligne ExecStart.

je peux avoir une version légèrement plus récente de systemd - quand je l'ai essayé, la sortie de systemctl status inclus ce message:

Executable path specifies a directory, ignoring: /bin/bash/ -c "cd /home/git/hsfzmun/server && /home/git/virtualenvs/hsfzmun/bin/daphne -b 0.0.0.0 -p 8001 -v2 config.asgi:channel_layer" 

En outre, vous pouvez envisager d'utiliser une ligne WorkingDirectory au service, au lieu de cd &&