Skip to content

gunicorn unrecognized arguments #5

@ankee2050

Description

@ankee2050

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=-

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions