From d4b437f923d0d8519a25f2e90a2f766c6b0f67d9 Mon Sep 17 00:00:00 2001 From: Renann Souza Date: Mon, 21 Dec 2020 14:02:38 -0300 Subject: [PATCH] =?UTF-8?q?refatora=20codigo=20com=20mudan=C3=A7as=20suger?= =?UTF-8?q?idas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/gunicorn_start.sh | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/scripts/gunicorn_start.sh b/scripts/gunicorn_start.sh index 9111ddeb2..d255dc00e 100755 --- a/scripts/gunicorn_start.sh +++ b/scripts/gunicorn_start.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash # As seen in http://tutos.readthedocs.org/en/latest/source/ndg.html -# Arquivo inicializador para o gunicorn/supervisorctl SAPL_DIR="/var/interlegis/sapl" @@ -12,12 +11,9 @@ then SAPL_DIR="$1" fi -#Carrega as variáveis de ambiente -export $(egrep -v '^#' $SAPL_DIR/sapl/.env | xargs) - NAME="SAPL" # Name of the application (*) -DJANGODIR=/var/interlegis/sapl/ # Django project directory (*) -SOCKFILE=/var/interlegis/sapl/run/gunicorn.sock # we will communicate using this unix socket (*) +DJANGODIR=$SAPL_DIR/ # Django project directory (*) +SOCKFILE=$SAPL_DIR/run/gunicorn.sock # we will communicate using this unix socket (*) USER=`whoami` # the user to run as (*) GROUP=`whoami` # the group to run as (*) NUM_WORKERS=3 # how many worker processes should Gunicorn spawn (*) @@ -31,12 +27,8 @@ echo "Starting $NAME as `whoami` on base dir $SAPL_DIR" # Ativa ambiente virtual cd $DJANGODIR -if [ "$SAPL_VIRTUAL_ENV" ] -then -source $SAPL_VIRTUAL_ENV/bin/activate -else -source /var/interlegis/.virtualenvs/sapl/bin/activate -fi +source $SAPL_DIR/../.virtualenvs/sapl/bin/activate + export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE export PYTHONPATH=$DJANGODIR:$PYTHONPATH