我遵循此article来部署我的Django项目。我使用以下配置在gunicorn.service
中创建了/etc/systemd/system/gunicorn.service
文件:
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=azizbek
Group=www-data
WorkingDirectory=/home/admin/respositories/ninersComingSoon
ExecStart=/root/.local/share/virtualenvs/ninersComingSoon-_UZsUc5R/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/admin/repositories/ninersComingSoon/niners.sock ninersComingSoon.wsgi:application
[Install]
WantedBy=multi-user.target
我的项目的位置是/home/admin/respositories/ninersComingSoon
当我跑步时
systemctl start gunicorn
systemctl enable gunicorn
它必须在项目目录中创建niners.sock
文件,但不是。
然后,我键入此命令来找出我做错了什么。
journalctl -u gunicorn
结果是
Dec 05 02:05:26 server.niners.uz systemd[1]: Started gunicorn daemon.
Dec 05 02:05:26 server.niners.uz systemd[1]: gunicorn.service: Main process exited, code=exited, status=203/EXEC
Dec 05 02:05:26 server.niners.uz systemd[1]: gunicorn.service: Unit entered failed state.
Dec 05 02:05:26 server.niners.uz systemd[1]: gunicorn.service: Failed with result 'exit-code'.
那么您能帮我解决这个问题吗?
答案 0 :(得分:0)
问题出在WorkingDirectory
中。路径不正确。应该有.../repositories/...
而不是.../respositories/...