gunicorn active:失败,为什么不激活 gunicorn?

gunicorn active:失败,为什么不激活 gunicorn?

我有 ubuntu 服务器 20.04 和一个 django 项目,我设置了
/etc/systemd/system/gunicorn.socket

Description=gunicorn socket

[Socket]
ListenStream=/run/gunicorn.sock

[Install]
WantedBy=sockets.target


/etc/systemd/system/gunicorn.service

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

[Service]
User=sammy
Group=www-data
WorkingDirectory=/home/sammy/myprojectdir
ExecStart=/home/sammy/myprojectdir/myprojectenv/bin/gunicorn \
          --access-logfile - \
          --workers 3 \
          --bind unix:/run/gunicorn.sock \
          myproject.wsgi:application

[Install]
WantedBy=multi-user.target

我有这个错误

 gunicorn.service - gunicorn daemon
     Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2022-03-16 11:49:31 +0330; 12min ago
TriggeredBy: ● gunicorn.socket
    Process: 1891 ExecStart=/home/sammy/myprojectdir/myprojectenv/bin/gunicorn --access-logfile - --workers 3 --bi>   Main PID: 1891 (code=exited, status=217/USER)

Mar 16 11:49:31 srv174847 systemd[1]: Started gunicorn daemon.
Mar 16 11:49:31 srv174847 systemd[1891]: gunicorn.service: Failed to determine user credentials: No such process:: Failed to determine user credentials: No such process
Mar 16 11:49:31 srv174847 systemd[1891]: gunicorn.service: Failed at step USER spawning /home/sammy/myprojectdir/myprojectenv/bin/gunicorn: No such process
Mar 16 11:49:31 srv174847 systemd[1]: gunicorn.service: Main process exited, code=exited, status=217/USER
Mar 16 11:49:31 srv174847 systemd[1]: gunicorn.service: Failed with result 'exit-code'.

请帮我

相关内容