pandora/etc/init/pandora-encoding.conf
Will Thompson 7554b0c105 init: restart celery workers on 'reload' (fixes #2904)
Sending HUP to the parent of a family of celery workers causes the
parent to re-exec itself, spawning a new set of child workers without
terminating the old ones.

So instead we send TERM to the parent on 'reload', which cleans up the
children, and rely on systemd/upstart to respawn the whole family.
2016-03-17 10:32:58 +01:00

31 lines
810 B
Text

# pandora encoding daemon
#
description "pandora encoding daemon"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
reload signal TERM
env VENV=/srv/pandora
env USER=pandora
env HOME=/home/pandora
env LANG=en_US.UTF-8
pre-start script
test -e /var/log/pandora || (mkdir -p /var/log/pandora && chown $USER:$USER /var/log/pandora)
test -e /var/run/pandora || (mkdir -p /var/run/pandora && chown $USER:$USER /var/run/pandora)
end script
exec start-stop-daemon \
--start -c $USER -d $VENV/pandora \
--pidfile /var/run/pandora/pandora-encoding.pid \
--exec $VENV/bin/python -- \
$VENV/pandora/manage.py celeryd \
-Q encoding \
-n pandora-encoding \
--pidfile /var/run/pandora/pandora-encoding.pid \
-f /var/log/pandora/pandora-encoding.log \
-l INFO