Django主管FATAl退出太快如何改进?

时间:2017-07-30 16:59:48

标签: django ubuntu nginx supervisor

我在django使用主管我的主管得到了错误。 我的服务器在Ubuntu 16.04.2 x64上我使用,nginx,gunicortn,supervisor,postgresql。

  

FATAl Exited too quickly (process log may have details)

     

如果你有一些想法如何解决这个问题,请告诉我你的意见   思想

这是我的主管文件。

[program:chart_app]
command = /webapps/chart_app/bin/gunicorn_start
user = chart 
stdout_logfile = /webapps/chart_app/logs/gunicorn_supervisor.log
redirect_stderr = true 
environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8

日志中的错误

> supervisor: couldn't exec /webapps/chart_app/bin/gunicorn_start:
> ENOEXEC supervisor: child process was not spawned supervisor: couldn't
> exec /webapps/chart_app/bin/gunicorn_start: ENOEXEC supervisor: child
> process was not spawned supervisor: couldn't exec
> /webapps/chart_app/bin/gunicorn_start: ENOEXEC supervisor: child
> process was not spawned supervisor: couldn't exec
> /webapps/chart_app/bin/gunicorn_start: ENOEXEC supervisor: child
> process was not spawned supervisor: couldn't exec
> /webapps/chart_app/bin/gunicorn_start: ENOEXEC supervisor: child
> process was not spawned supervisor: couldn't exec
> /webapps/chart_app/bin/gunicorn_start: ENOEXEC supervisor: child
> process was not spawned supervisor: couldn't exec
> /webapps/chart_app/bin/gunicorn_start: ENOEXEC supervisor: child
> process was not spawned supervisor: couldn't exec
> /webapps/chart_app/bin/gunicorn_start: ENOEXEC supervisor: child
> process was not spawned

gunicrotn_start

#!/bin/bash

NAME="chart_app"                                  # Name of the application
DJANGODIR=/webapps/chart_app/src             # Django project directory
SOCKFILE=/webapps/chart_app/run/gunicorn.sock  # we will communicte using this unix socket
USER=chart                                        # the user to run as
GROUP=webapps                                     # the group to run as
NUM_WORKERS=3                                     # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=src.settings             # which settings file should Django use
DJANGO_WSGI_MODULE=src.wsgi                     # WSGI module name

echo "Starting $NAME as `whoami`"

# Activate the virtual environment
cd $DJANGODIR
source ../bin/activate
export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
export PYTHONPATH=$DJANGODIR:$PYTHONPATH

# Create the run directory if it doesn't exist
RUNDIR=$(dirname $SOCKFILE)
test -d $RUNDIR || mkdir -p $RUNDIR

# Start your Django Unicorn
# Programs meant to be run under supervisor should not daemonize themselves (do not use --daemon)
exec ../bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
  --name $NAME \
  --workers $NUM_WORKERS \
  --user=$USER --group=$GROUP \
  --bind=unix:$SOCKFILE \
  --log-level=debug \
--log-file=-

0 个答案:

没有答案