update init scripts

This commit is contained in:
j 2016-02-20 00:39:07 +05:30
parent 7a6515183a
commit 09ac3c32b0
3 changed files with 8 additions and 6 deletions

View file

@ -17,9 +17,9 @@ DESC="pan.do/ra daemon"
NAME=pandora NAME=pandora
PANDORA_BASE=/srv/pandora PANDORA_BASE=/srv/pandora
DAEMON_USER="pandora" DAEMON_USER="pandora"
DAEMON_NAME=bin/gunicorn_django DAEMON_NAME=bin/gunicorn
DAEMON="$PANDORA_BASE/$DAEMON_NAME" DAEMON="$PANDORA_BASE/$DAEMON_NAME"
DAEMON_ARGS="--bind 127.0.0.1:2620 --max-requests 1000 --timeout 90 --log-level info --log-file /var/log/pandora/$NAME.log --workers 5" DAEMON_ARGS="wsgi:application --bind 127.0.0.1:2620 --max-requests 1000 --timeout 90 --log-level info --log-file /var/log/pandora/$NAME.log --workers 5"
PIDFILE=/var/run/$NAME.pid PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME SCRIPTNAME=/etc/init.d/$NAME

View file

@ -17,12 +17,13 @@ pre-start script
test -e /var/log/pandora || (mkdir -p /var/log/pandora && chown $USER:$USER /var/log/pandora) test -e /var/log/pandora || (mkdir -p /var/log/pandora && chown $USER:$USER /var/log/pandora)
test -e /var/run/pandora || (mkdir -p /var/run/pandora && chown $USER:$USER /var/run/pandora) test -e /var/run/pandora || (mkdir -p /var/run/pandora && chown $USER:$USER /var/run/pandora)
cd $VENV/pandora cd $VENV/pandora
/usr/bin/sudo -u $USER ./manage.py compile_pyc /usr/bin/sudo -u $USER ./manage.py compile_pyc -p $VENV/pandora
end script end script
exec start-stop-daemon \ exec start-stop-daemon \
--start -c $USER -d $VENV/pandora --exec \ --start -c $USER -d $VENV/pandora --exec \
$VENV/bin/gunicorn_django -- \ $VENV/bin/gunicorn -- \
wsgi:application \
--bind 127.0.0.1:2620 \ --bind 127.0.0.1:2620 \
--timeout 90 \ --timeout 90 \
--max-requests 1000 \ --max-requests 1000 \

View file

@ -10,8 +10,9 @@ PIDFile=/run/pandora/pandora.pid
WorkingDirectory=/srv/pandora/pandora WorkingDirectory=/srv/pandora/pandora
StandardOutput=syslog StandardOutput=syslog
StandardError=syslog StandardError=syslog
ExecStartPre=/srv/pandora/pandora/manage.py compile_pyc ExecStartPre=/srv/pandora/pandora/manage.py compile_pyc -p /srv/pandora/pandora
ExecStart=/srv/pandora/bin/gunicorn_django \ ExecStart=/srv/pandora/bin/gunicorn \
wsgi:application \
-p /run/pandora/pandora.pid \ -p /run/pandora/pandora.pid \
--bind 127.0.0.1:2620 \ --bind 127.0.0.1:2620 \
--timeout 90 \ --timeout 90 \