A
A
Alan Chernov2017-05-07 17:52:35
Django
Alan Chernov, 2017-05-07 17:52:35

Why doesn't sustemd start the service for gunicorn?

Create gunicorn.service [
Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=root
Group=root
WorkingDirectory=/root/myproject
ExecStart=/root/myproject/venv/bin/gunicorn --workers 3 --bind unix:/root/myproject/myproject.sock
myproject.wsgi:application
[Install]
WantedBy=multi-user.target
I try to start, I execute the command:
sudo systemctl start gunicorn
terminal says:
Failed to start gunicorn.service: Unit gunicorn.service failed to load: Bad message. See system logs and 'systemctl status gunicorn.service' for details.
command: sustemctl status gunicorn gives :
gunicorn.service - gunicorn daemon
Loaded: error (Reason: Bad message)
Active: failed (Result: exit-code) since Sun 2017-05-07 13:48:10 UTC; 1h 1min ago
Main PID: 6639 (code=exited, status=200/CHDIR)
May 07 13:48:10 142643.simplecloud.club systemd[1]: Starting gunicorn daemon...
May 07 13:48:10 142643. simplecloud.club systemd[1]: Started gunicorn daemon.
May 07 13:48:10 142643.simplecloud.club systemd[6639]: Failed at step CHDIR spawning /myproject/venv/bin/gunicorn:...tory
May 07 13:48:10 142643.simplecloud.club systemd[1 ]: gunicorn.service: main process exited, code=exited, status=200/CHDIR
May 07 13:48:10 142643.simplecloud.club systemd[1]: Unit gunicorn.service entered failed state.
May 07 14:00:45 142643.simplecloud.club systemd[1]: [/etc/systemd/system/gunicorn.service:9] Missing '='.
May 07 14:18:49 142643.simplecloud.club systemd[1]: [/etc/systemd/system/gunicorn.service:9] Missing '='.
Hint: Some lines were ellipsized, use -l to show in full.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
maxfox, 2017-05-08
@maxfox

Well, judging by the logs, you need to check that /root/myproject/venv/bin/gunicorn exists. You abbreviated the most important line, but judging by the ending, it says "No such file or directory". I'd check.. Maybe venv is the culprit (just a guess), try without it.

O
Oleg Shulepov, 2020-04-01
@neuro

In the log, in black and white, there is no '=' on line 9

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question