gunicorn not starting workers

折月煮酒 提交于 2020-01-22 12:45:05

问题


When i run this command

[jenia@arch app]../bin/gunicorn zones.wsgi:application --bind localht:8000

The gunicorn server runs at localhost:8000. It doesnt return anything to the console as I assume it should. Just runs silently.

When I run my script in bin/gunicorn_start the server still runs silently and features odd behaviour. If I input an address that django can't resolve it gives me internal server error and that's it. no stack trace no nothing.

This is the bin/gunicorn_start script:

#!/bin/bash

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

echo "Starting $NAME as `whoami`"

# Activate the virtual environment
cd $DJANGODIR
source 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)
echo "about to exec exec is" $DJANGO_WSGI_MODULE
exec ../bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
--name $NAME \
--workers $NUM_WORKERS \
--user=$USER --group=$GROUP \
--log-level=debug \
--bind=unix:$SOCKFILE

By the way, I created a virtualen at by doing:

cd proj05
virtualenv .
source bin/activate
pip install django
pip install gunicorn
...

Can anyone tell me how to make gunicorn output the debug information instead of just internal server error?

Thanks in advance.


回答1:


I was able to fix this problem by reverting back to Gunicorn 18.0.0.

pip uninstall gunicorn
pip install gunicorn==18.0.0

Not the ideal solution. Perhaps it's worth making a bug ticket about this problem. My concern is that I can't actually identify what the problem is...so how do I make a proper bug ticket? haha




回答2:


gunicorn doesn't return to the console by default now. Use the option --log-file=- to do it.

Also the error should be fixed in https://github.com/benoitc/gunicorn/issues/785 .

I will make a release tomorrow.




回答3:


You should use --log-file=- option

For more information see: http://gunicorn-docs.readthedocs.org/en/latest/faq.html#why-i-don-t-see-any-logs-in-the-console



来源:https://stackoverflow.com/questions/24222608/gunicorn-not-starting-workers

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!