I
I
Ivan Akimov2022-04-17 12:35:15
ubuntu
Ivan Akimov, 2022-04-17 12:35:15

The created service is not running ( status=200/CHDIR ). How to fix?

Good morning.
Immediately I ask for indulgence, because. I understand this badly ...
I create a service:

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

[Service]
User=root
WorkingDirectory=/suite/belka-tour #путь до каталога с файлом manage.py
ExecStart=/suite/belka-tour/venv/bin/gunicorn --workers 5 --bind unix:/run/gunicorn.sock ghproj.wsgi:application
#путь до файла gunicorn в виртуальном окружении

[Install]
WantedBy=multi-user.target


On startup I get an error:
● belkatour.service - gunicorn daemon
     Loaded: loaded (/etc/systemd/system/belkatour.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2022-04-17 12:24:58 MSK; 5s ago
TriggeredBy: ● belkatour.socket
    Process: 2004166 ExecStart=/suite/belka-tour/venv/bin/gunicorn --workers 5 --bind unix:/run/gunicorn.sock ghproj.wsgi:application (code=exited, status=200/CHDIR)
   Main PID: 2004166 (code=exited, status=200/CHDIR)

апр 17 12:24:58 ubuntu systemd[1]: Started gunicorn daemon.
апр 17 12:24:58 ubuntu systemd[2004166]: belkatour.service: Changing to the requested working directory failed: No such file or directory
апр 17 12:24:58 ubuntu systemd[2004166]: belkatour.service: Failed at step CHDIR spawning /suite/belka-tour/venv/bin/gunicorn: No such file or directory
апр 17 12:24:58 ubuntu systemd[1]: belkatour.service: Main process exited, code=exited, status=200/CHDIR
апр 17 12:24:58 ubuntu systemd[1]: belkatour.service: Failed with result 'exit-code'.


Although, the file is in place, which he complains about.

ls -la /suite/belka-tour/venv/bin/gunicorn
Получаем: -rwxr-xr-x 1 root root 237 апр 17 11:31 /suite/belka-tour/venv/bin/gunicorn

ls -la /run/gunicorn.sock
Получаем: srw-rw-rw- 1 root root 0 апр 17 11:43 /run/gunicorn.sock

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question