2013-02-12 07:58:12 +00:00
|
|
|
# pdfvideo gunicorn daemon
|
2013-02-12 07:49:16 +00:00
|
|
|
#
|
|
|
|
|
2013-02-12 07:58:12 +00:00
|
|
|
description "pdfvideo daemon"
|
2013-02-12 07:49:16 +00:00
|
|
|
|
|
|
|
start on runlevel [2345]
|
|
|
|
stop on runlevel [!2345]
|
|
|
|
kill timeout 5
|
|
|
|
respawn
|
|
|
|
|
2013-02-12 07:58:12 +00:00
|
|
|
env NAME=pdfvideo
|
|
|
|
env VENV=/srv/pdfvideo
|
|
|
|
env DAEMON_USER=pdfvideo
|
|
|
|
env HOME=/home/pdfvideo
|
2013-02-12 07:49:16 +00:00
|
|
|
|
|
|
|
script
|
2013-02-12 07:58:12 +00:00
|
|
|
test -e /var/log/$NAME || (mkdir -p /var/log/pdfvideo && chown $DAEMON_USER:$DAEMON_USER /var/log/$NAME)
|
|
|
|
cd $VENV/pdfvideo
|
2013-02-12 07:49:16 +00:00
|
|
|
exec /usr/bin/sudo -u $DAEMON_USER $VENV/bin/gunicorn_django \
|
|
|
|
--bind 127.0.0.1:2688 \
|
|
|
|
--timeout 90 \
|
|
|
|
--log-level info --log-file /var/log/$NAME/$NAME.log \
|
|
|
|
--workers 5
|
|
|
|
end script
|