update init script

This commit is contained in:
j 2013-08-26 15:56:36 +02:00
parent 8b5c0ed193
commit 71c59e3217

View file

@ -12,13 +12,18 @@ env VENV=/srv/oxdata
env USER=oxdata env USER=oxdata
env HOME=/home/oxdata env HOME=/home/oxdata
script pre-start script
test -e /var/log/oxdata || (mkdir -p /var/log/oxdata && chown $USER:$USER /var/log/oxdata) test -e /var/log/oxdata || (mkdir -p /var/log/oxdata && chown $USER:$USER /var/log/oxdata)
cd $VENV/oxdata test -e /var/run/oxdata || (mkdir -p /var/run/oxdata && chown $USER:$USER /var/run/oxdata)
exec /usr/bin/sudo -u $USER $VENV/bin/gunicorn_django \
--bind 127.0.0.1:8087 \
--timeout 90 \
--log-level info --log-file /var/log/oxdata/oxdata.log \
--workers 5 \
$VENV/oxdata/settings.py
end script end script
exec start-stop-daemon \
--pidfile /var/run/oxdata/oxdata.pid \
--start -c $USER -d $VENV/oxdata \
--exec $VENV/bin/gunicorn_django -- \
--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