-
Notifications
You must be signed in to change notification settings - Fork 110
Description
Hi Hardik,
I am stuck at starting the gunicorn service using shell script you provided.
I am getting below error-
gunicorn: error: unrecognized arguments: ubuntu /home/ubuntu/ankit/ems/run/gunicorn.sock
Here are the script details-
#!/bin/bash
NAME="ems"
DJANGODIR=/home/ubuntu/ankit/ems-
SOCKFILE=/home/ubuntu/ankit/ems-/run/gunicorn.sock
USER=ubuntu
GROUP=ubuntu
NUM_WORKERS=3
DJANGO_SETTINGS_MODULE=ems.settings
DJANGO_WSGI_MODULE=ems.wsgi
echo "Starting $NAME as whoami"
Activate the virtual environment
cd $DJANGODIR
source ../venv/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 /home/ubuntu/ankit/venv/bin/gunicorn ${DJANGO_WSGI_MODULE}:application
--name $NAME
--workers $NUM_WORKERS
--user = $USER --group=$GROUP
--bind = $SOCKFILE
--log-level=debug
--log-file=-