Django-主管。退出太快(进程日志可能包含详细信息)

时间:2019-04-18 16:05:51

标签: django supervisor

将我用Django编写的应用程序添加到Digitalocean时,它将获得以下代码(在“配置主管”步骤中)。

 my-app    FATAL     Exited too quickly (process log may have details)

为什么在运行命令“ sudo supervisorctl status my-app”(以检查服务器是否正常工作)时收到这样的错误?

我的my-app.conf

[program:my-app]
command =sh /home/my-app/env/bin/gunicorn_start
user = my-app
autostart = true
autorestart = true
redirect_stderr = true
stdout_logfile = /home/my-app/env/logs/gunicorn-error.log

我的gunicorn_start

#!/bin/sh

NAME="my-app"
DIR=/home/my-app/my_app/app_rama
USER=app
GROUP=app
WORKERS=3
BIND=unix:/home/my-app/env/run/gunicorn.sock
DJANGO_SETTINGS_MODULE=app_rama.settings
DJANGO_WSGI_MODULE=app_rama.wsgi
LOG_LEVEL=error

cd $DIR
source ../bin/activate

export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
export PYTHONPATH=$DIR:$PYTHONPATH

exec ../bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
  --name $NAME \
  --workers $WORKERS \
  --user=$USER \
  --group=$GROUP \
  --bind=$BIND \
  --log-level=$LOG_LEVEL \
  --log-file=-

我的日志

/home/my-app/env/bin/gunicorn_start: 19: exec: ../bin/gunicorn: not found
/home/my-app/env/bin/gunicorn_start: 14: /home/my-app/env/bin/gunicorn_start: source: not found
/home/my-app/env/bin/gunicorn_start: 19: exec: ../bin/gunicorn: not found
/home/my-app/env/bin/gunicorn_start: 14: /home/my-app/env/bin/gunicorn_start: source: not found
/home/my-app/env/bin/gunicorn_start: 19: exec: ../bin/gunicorn: not found
/home/my-app/env/bin/gunicorn_start: 14: /home/my-app/env/bin/gunicorn_start: source: not found
/home/my-app/env/bin/gunicorn_start: 19: exec: ../bin/gunicorn: not found

基本目录

/home/my-app (my env here)
/home/my-app/my_app/app_rama (manage.py)
/home/my-app/my_app/app_rama/app_rama (files here manage.py, wsgi, urls etc.)
/home/my-app/my_app/app_rama/app (files like template, urls_app etc.)

任何帮助将不胜感激。

0 个答案:

没有答案