2010-09-14 17:04:27 +00:00
|
|
|
# pandora gunicorn daemon
|
|
|
|
#
|
|
|
|
|
|
|
|
description "pandora daemon"
|
|
|
|
|
|
|
|
start on runlevel [2345]
|
|
|
|
stop on runlevel [!2345]
|
2010-11-11 22:52:03 +00:00
|
|
|
kill timeout 5
|
2010-09-14 17:04:27 +00:00
|
|
|
respawn
|
|
|
|
|
2010-11-11 22:52:03 +00:00
|
|
|
env VENV=/srv/pandora
|
|
|
|
env USER=pandora
|
2010-11-30 23:33:42 +00:00
|
|
|
env HOME=/home/pandora
|
2010-09-14 17:04:27 +00:00
|
|
|
|
2013-08-23 16:47:45 +00:00
|
|
|
pre-start script
|
2010-11-30 21:41:58 +00:00
|
|
|
test -e /var/log/pandora || (mkdir -p /var/log/pandora && chown $USER:$USER /var/log/pandora)
|
2011-10-19 14:27:38 +00:00
|
|
|
test -e /var/run/pandora || (mkdir -p /var/run/pandora && chown $USER:$USER /var/run/pandora)
|
2010-11-11 22:52:03 +00:00
|
|
|
cd $VENV/pandora
|
2013-05-07 16:40:45 +00:00
|
|
|
/usr/bin/sudo -u $USER ./manage.py compile_pyc
|
2010-11-11 22:52:03 +00:00
|
|
|
end script
|
2013-08-23 16:47:45 +00:00
|
|
|
|
|
|
|
exec start-stop-daemon \
|
|
|
|
--start -c $USER -d $VENV/pandora --exec \
|
|
|
|
$VENV/bin/gunicorn_django -- \
|
|
|
|
--bind 127.0.0.1:2620 \
|
|
|
|
--timeout 90 \
|
2013-08-25 15:11:38 +00:00
|
|
|
--max-requests 1000 \
|
2013-08-23 16:47:45 +00:00
|
|
|
-p /var/run/pandora/pandora.pid \
|
|
|
|
--log-level info --log-file /var/log/pandora/pandora.log \
|
|
|
|
--workers 5
|