X
X
xxx2017-05-13 13:33:56
Django
xxx, 2017-05-13 13:33:56

Django + gunicorn Active: failed (Result: exit-code)?

Deploy jungi using the tutorial
https://www.digitalocean.com/community/tutorials/h...
The catch is after creating and configuring gunicorn.service in (/etc/systemd/system/)
gunicorn.service

[Unit]
Description=gunicorn daemon
After=network.target

[Service]
User=splitpoint
Group=www-data
WorkingDirectory=/opt/blog/
ExecStart=/opt/blog/venv/bin/gunicorn --workers 3 --bind unix:/opt/blog/myproject

[Install]
WantedBy=multi-user.target

Project structure:
[email protected]:/opt/blog$ tree
.
├── myproject
│   ├── manage.py
│   ├── myproject
│   │   ├── gunicorn.config.py
│   │   ├── __init__.py
│   │   ├── __init__.pyc
│   │   ├── settings.py
│   │   ├── settings.pyc
│   │   ├── urls.py
│   │   └── wsgi.py
│   └── static
│       └── admin
│           ├── css
│           etc
└── venv
    ├── bin
    │   ├── activate
        etc

After
sudo systemctl start gunicorn
    sudo systemctl enable gunicorn
    sudo systemctl status gunicorn

I receive
● gunicorn.service - gunicorn daemon
   Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled)
   Active: failed (Result: exit-code) since Sat 2017-05-13 11:47:49 MSK; 29s ago
 Main PID: 56584 (code=exited, status=203/EXEC)

May 13 11:47:49 debian systemd[1]: Starting gunicorn daemon...
May 13 11:47:49 debian systemd[1]: Started gunicorn daemon.
May 13 11:47:49 debian systemd[56584]: Failed at step EXEC spawning /opt/bl...ry
May 13 11:47:49 debian systemd[1]: gunicorn.service: main process exited, c...EC
May 13 11:47:49 debian systemd[1]: Unit gunicorn.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.

How to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim kyklaed, 2017-05-14
@kyklaed

If the daemon does not start, then check the user and the group
User=splitpoint
Group=www-data
They clearly do not match yours. If your user name is
vasya, then the group is most likely vasya

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question