From 1bf81977b7d34bb7d0e988167fb4e914c4111afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Fri, 4 Apr 2014 17:58:25 -0300 Subject: [PATCH] Adicionado gunicorn runserver script --- bin/run_sigi | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 bin/run_sigi diff --git a/bin/run_sigi b/bin/run_sigi new file mode 100755 index 0000000..fddd9eb --- /dev/null +++ b/bin/run_sigi @@ -0,0 +1,26 @@ +#!/bin/bash + +NAME="sigi" +DJANGODIR=/var/aplicacoes/sigi +SOCKFILE=/var/run/sigi/sigi.sock +USER=sigi +GROUP=sigi +NUM_WORKERS=3 # = 2 * CPUs + 1 +DJANGO_SETTINGS_MODULE=sigi.settings +DJANGO_WSGI_MODULE=sigi.wsgi + +echo "Starting $NAME as `whoami`" + +cd $DJANGODIR +export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE +export PYTHONPATH=$DJANGODIR:$PYTHONPATH + +RUNDIR=$(dirname $SOCKFILE) +test -d $RUNDIR || mkdir -p $RUNDIR + +exec gunicorn ${DJANGO_WSGI_MODULE}:application \ +--name $NAME \ +--workers $NUM_WORKERS \ +--user=$USER --group=$GROUP \ +--log-level=debug \ +--bind=unix:$SOCKFILE