2011-02-23 09:57:23 +00:00
|
|
|
# oxdata gunicorn daemon
|
|
|
|
#
|
|
|
|
|
|
|
|
description "oxdata daemon"
|
|
|
|
|
|
|
|
start on runlevel [2345]
|
|
|
|
stop on runlevel [!2345]
|
2011-07-30 11:31:04 +00:00
|
|
|
kill timeout 5
|
2011-02-23 09:57:23 +00:00
|
|
|
respawn
|
|
|
|
|
2011-07-30 11:31:04 +00:00
|
|
|
env VENV=/srv/oxdata
|
|
|
|
env USER=oxdata
|
|
|
|
env HOME=/home/oxdata
|
2011-02-23 09:57:23 +00:00
|
|
|
|
2013-08-26 13:56:36 +00:00
|
|
|
pre-start script
|
2011-07-30 11:31:04 +00:00
|
|
|
test -e /var/log/oxdata || (mkdir -p /var/log/oxdata && chown $USER:$USER /var/log/oxdata)
|
2013-08-26 13:56:36 +00:00
|
|
|
test -e /var/run/oxdata || (mkdir -p /var/run/oxdata && chown $USER:$USER /var/run/oxdata)
|
2011-07-30 11:31:04 +00:00
|
|
|
end script
|
2013-08-26 13:56:36 +00:00
|
|
|
|
|
|
|
exec start-stop-daemon \
|
|
|
|
--pidfile /var/run/oxdata/oxdata.pid \
|
|
|
|
--start -c $USER -d $VENV/oxdata \
|
2016-03-06 10:35:46 +00:00
|
|
|
--exec $VENV/bin/gunicorn -- \
|
|
|
|
wsgi:application \
|
2013-08-26 13:56:36 +00:00
|
|
|
--bind 127.0.0.1:8087 \
|
|
|
|
--workers 5 \
|
|
|
|
--max-requests 1000 \
|
|
|
|
--log-file /var/log/oxdata/oxdata.log \
|
|
|
|
--pidfile /var/run/oxdata/oxdata.pid \
|
|
|
|
--log-level info
|