2010-09-14 19:04:27 +02:00
|
|
|
# pandora gunicorn daemon
|
|
|
|
#
|
|
|
|
|
|
|
|
description "pandora daemon"
|
|
|
|
|
|
|
|
start on runlevel [2345]
|
|
|
|
stop on runlevel [!2345]
|
2010-11-11 23:52:03 +01:00
|
|
|
kill timeout 5
|
2010-09-14 19:04:27 +02:00
|
|
|
respawn
|
|
|
|
|
2010-11-11 23:52:03 +01:00
|
|
|
env VENV=/srv/pandora
|
|
|
|
env USER=pandora
|
2010-12-01 00:33:42 +01:00
|
|
|
env HOME=/home/pandora
|
2014-01-18 12:03:25 +00:00
|
|
|
env LANG=en_US.UTF-8
|
2010-09-14 19:04:27 +02:00
|
|
|
|
2013-08-23 18:47:45 +02:00
|
|
|
pre-start script
|
2010-11-30 22:41:58 +01:00
|
|
|
test -e /var/log/pandora || (mkdir -p /var/log/pandora && chown $USER:$USER /var/log/pandora)
|
2011-10-19 16:27:38 +02:00
|
|
|
test -e /var/run/pandora || (mkdir -p /var/run/pandora && chown $USER:$USER /var/run/pandora)
|
2010-11-11 23:52:03 +01:00
|
|
|
cd $VENV/pandora
|
2016-02-20 00:39:07 +05:30
|
|
|
/usr/bin/sudo -u $USER ./manage.py compile_pyc -p $VENV/pandora
|
2010-11-11 23:52:03 +01:00
|
|
|
end script
|
2013-08-23 18:47:45 +02:00
|
|
|
|
|
|
|
exec start-stop-daemon \
|
|
|
|
--start -c $USER -d $VENV/pandora --exec \
|
2016-03-07 14:25:24 +05:30
|
|
|
$VENV/bin/gunicorn -- wsgi:application \
|
|
|
|
-c $VENV/pandora/gunicorn_config.py -p /var/run/pandora/pandora.pid
|