无法启动Gunicorn服务。可以从命令行运行

时间:2020-06-23 01:22:00

标签: nginx gunicorn centos8

我无法启动Gunicorn服务。如果我从命令行运行它,它将起作用。但不能通过服务。 我正在使用centos8。不确定selinux是否有问题。

Her是 journalctl -xe 命令的输出。

Jun 23 01:15:06 scraping-automation sudo[13155]: pam_unix(sudo:session): session opened for user root by kalpeshtawde(uid=0)
Jun 23 01:15:06 scraping-automation systemd[1]: Started Gunicorn WSGI socket.
-- Subject: Unit gunicorn.service has finished start-up
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
-- 
-- Unit gunicorn.service has finished starting up.
-- 
-- The start-up result is RESULT.
Jun 23 01:15:06 scraping-automation sudo[13155]: pam_unix(sudo:session): session closed for user root
Jun 23 01:15:06 scraping-automation systemd[13159]: gunicorn.service: Failed to execute command: Permission denied
Jun 23 01:15:06 scraping-automation systemd[13159]: gunicorn.service: Failed at step EXEC spawning /home/kalpeshtawde/platform/backend/backendenv/bin/gunicorn: Perm>
-- Subject: Process /home/kalpeshtawde/platform/backend/backendenv/bin/gunicorn could not be executed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
-- 
-- The process /home/kalpeshtawde/platform/backend/backendenv/bin/gunicorn could not be executed and failed.
-- 
-- The error number returned by this process is 13.
Jun 23 01:15:06 scraping-automation systemd[1]: gunicorn.service: Main process exited, code=exited, status=203/EXEC
Jun 23 01:15:06 scraping-automation systemd[1]: gunicorn.service: Failed with result 'exit-code’.

这是我的服务文件,

[Unit]
Description=Gunicorn WSGI socket
Requires=gunicorn.socket
After=network.target
[Service]
User=kalpeshtawde
Group=kalpeshtawde
WorkingDirectory=/home/kalpeshtawde/platform/backend
ExecStart=/home/kalpeshtawde/platform/backend/backendenv/bin/gunicorn --preload --access-logfile - --workers 3 --bind unix:backend.sock backend.wsgi
[Install]
WantedBy=multi-user.target

独角兽文件

backendenv) [kalpeshtawde@scraping-automation backend]$ ls -tlra /home/kalpeshtawde/platform/backend/backendenv/bin/gunicorn
-rwxr-xr-x. 1 kalpeshtawde kalpeshtawde 258 Jun 23 00:42 /home/kalpeshtawde/platform/backend/backendenv/bin/gunicorn

请帮助。

0 个答案:

没有答案