【问题标题】:How to solve the error "Executable path is not absolute, ignoring:"如何解决错误“可执行路径不是绝对的,忽略:”
【发布时间】:2023-03-30 08:01:01
【问题描述】:

我目前正在使用DjangoNginxGunicornPostgresqlAmazon Linux2 中开发应用程序。

我已经为Gunicorn 创建并配置了一个系统文件,以便在操作系统启动时工作,但是在启动gunicorn 后,我收到以下错误...

6 月 8 日 18:18:04 ip-172-31-16-86.us-east-2.compute.internal systemd[1]: [/etc/systemd/system/gunicorn.service:10] 可执行路径不是 绝对的,忽略:gunicorn --access-logfile - --workers 3 --bind unix:/home/myname/django_project/django_project.sock ......

6 月 8 日 18:18:04 ip-172-31-16-86.us-east-2.compute.internal systemd[1]: gunicorn.service 缺少 ExecStart= 和 ExecStop= 设置。 拒绝。

我确定文件中指定的绝对路径是正确的,但我得到了错误。

我该如何解决这个问题?

*注意: Amazon Linux2 不包括www-data 组,所以我使用groupadd 命令创建。


gunicorn.service

[Unit]
Description=gunicorn daemon
After=network.target
 
 
[Service]
User=myname
Group=www-data
WorkingDirectory=/home/myname/django_project
ExecStart=/home/myname/venv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/myname/django_project/django_project.sock django_project.wsgi:application
 
 
[Install]
WantedBy=multi-user.target

目录结构

home
 │
 └─myname
    │
    ├─django_project
    │    ├─django_project
    │    ├─manage.py
    │    └─django_project.sock
    │  
    └─venv
         └─bin
            └─gunicorn

操作系统 Amazon Linux2

独角兽 20.1.0

boto 2.49.0

Django 3.2.4

django-ses 2.0.0

【问题讨论】:

    标签: django gunicorn amazon-linux-2


    【解决方案1】:

    希望其他人会有更好的答案或建议,但this discussion 强调要仔细检查 Gunicorn 可执行文件的路径是否存在或确保您的环境能够识别。

    This discussion 还进一步强调检查一切是否安装正确

    【讨论】:

      猜你喜欢
      • 2018-07-18
      • 2015-12-29
      • 1970-01-01
      • 2016-09-12
      • 1970-01-01
      • 1970-01-01
      • 2018-06-18
      • 2011-08-10
      • 1970-01-01
      相关资源
      最近更新 更多