DJANGO: Невозможно запустить gunicorn из файла конфигурации сервиса - PullRequest
0 голосов
/ 16 октября 2019

Я не могу запустить gunicorn из файла конфигурации.

он отлично работает из:

gunicorn --bind 0.0.0.0:8000 myproject.wsgi

служебный файл:

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

    [Service]
    User=nigsdtm
    WorkingDirectory=/home/nigsdtm/django_projects/PID/PID_webinterface

    ExecStart=/home/nigsdtm/django_projects/PID/PID_webinterface/pidvirtualenv/bin/$
              --access-logfile - \
              --workers 3 \
              --bind unix:/run/gunicorn.sock \
              mysite.wsgi:application

    [Install]
    WantedBy=multi-user.target


    project root(where manage.py is located):/home/nigsdtm/django_projects/PID/PID_webinterface

    virtual env: /home/nigsdtm/django_projects/PID/PID_webinterface/pidvirtualenv

sudo systemctl status gunicorn.socket:

     gunicorn.socket - gunicorn socket
       Loaded: loaded (/etc/systemd/system/gunicorn.socket; enabled; vendor preset: enabled)
       Active: active (listening) since Wed 2019-10-16 13:49:57 UTC; 2h 47min ago
       Listen: /run/gunicorn.sock (Stream)

file / run / gunicorn. носок - ок

/run/gunicorn.sock: socket

sudo journalctl -u gunicorn.socket:

Oct 16 12:19:00 nigsdtm systemd[1]: Listening on gunicorn socket.
    Oct 16 12:22:22 nigsdtm systemd[1]: gunicorn.socket: Unit entered failed state.

статус sudo systemctl gunicorn: - не в порядке

gunicorn.service - gunicorn daemon
       Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
       Active: failed (Result: exit-code) since Wed 2019-10-16 13:58:04 UTC; 2h 41min ago
     Main PID: 1038 (code=exited, status=203/EXEC)

    Oct 16 13:58:04 nigsdtm systemd[1]: Started gunicorn daemon.
    Oct 16 13:58:04 nigsdtm systemd[1]: gunicorn.service: Main process exited, code=exited, status=203/EXEC
    Oct 16 13:58:04 nigsdtm systemd[1]: gunicorn.service: Unit entered failed state.
    Oct 16 13:58:04 nigsdtm systemd[1]: gunicorn.service: Failed with result 'exit-code'.
    Oct 16 14:05:47 nigsdtm systemd[1]: [/etc/systemd/system/gunicorn.service:12] Missing '='.

curl --unix-socket /run/gunicorn.sock localhost

curl: (56) Recv failure: Connection reset by peer

sudo journalctl -u gunicorn:

Oct 16 16:43:41 nigsdtm systemd[1]: Started gunicorn daemon.
    Oct 16 16:43:41 nigsdtm systemd[1]: gunicorn.service: Main process exited, code=exited, status=203/EXEC
    Oct 16 16:43:41 nigsdtm systemd[1]: gunicorn.service: Unit entered failed state.
    Oct 16 16:43:41 nigsdtm systemd[1]: gunicorn.service: Failed with result 'exit-code'.
    Oct 16 16:43:41 nigsdtm systemd[1]: gunicorn.service: Start request repeated too quickly.
    Oct 16 16:43:41 nigsdtm systemd[1]: Failed to start gunicorn daemon.
    Oct 16 16:43:41 nigsdtm systemd[1]: gunicorn.service: Failed with result 'start-limit-hit'.

Любые идеи о том, что может быть проблемой и как ее можно решить?

...