Gunicorn.service: Не удалось определить учетные данные пользователя: Нет такого процесса - django, gunicorn и nginx

Когда я запускаю sudo systemctl status gunicorn, я получаю следующую ошибку:

● gunicorn.service - gunicorn daemon
   Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2022-02-08 07:29:18 UTC; 17min ago
 Main PID: 21841 (code=exited, status=217/USER)

Feb 08 07:29:18 ip-172-31-37-113 systemd[1]: Started gunicorn daemon.
Feb 08 07:29:18 ip-172-31-37-113 systemd[21841]: gunicorn.service: Failed to determine user credentials: No such process
Feb 08 07:29:18 ip-172-31-37-113 systemd[21841]: gunicorn.service: Failed at step USER spawning /home/ubuntu/bookclub/venv/bin/gun
Feb 08 07:29:18 ip-172-31-37-113 systemd[1]: gunicorn.service: Main process exited, code=exited, status=217/USER
Feb 08 07:29:18 ip-172-31-37-113 systemd[1]: gunicorn.service: Failed with result 'exit-code'.

Я следую этому руководству от DigitalOcean, чтобы разместить мой веб-сайт Django на моем экземпляре EC2. Для этого я использую Nginx и Gunicorn с Django.

Это мой gunicorn.service файл по адресу /etc/systemd/system/gunicorn.service:

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

[Service]
User=sammy
Group=www-data
WorkingDirectory=/home/ubuntu/bookclub
ExecStart=/home/ubuntu/bookclub/venv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/ubuntu/bookclub/books.sock books.wsgi:application

[Install]
WantedBy=multi-user.target

Я проверил наличие books.sock в папке проекта с помощью ls и увидел, что books.sock не существует.

Вернуться на верх