# Where the real starting happens. # We need multiple celeryd conf since we want multiple RhodeCode instances # running, and each needs its own celery daemon. The instances are created on # the APPINI variables, passed by celeryd-start.conf upstart script. # Celery instances should not be started nor stoppe using this, but rather # with celeryd-start and celeryd-stop, taht will take care of the instance # variables. description "Celery Upstart Job" author "Milo Casagrande " start on starting rhodecode stop on stopping rhodecode respawn respawn limit 10 5 umask 0022 env HOME="/home/rhodecode" env USER="rhodecode" env GROUP="rhodecode" env APPINI="production-0.ini" limit nofile 4096 65536 script PIDFILE="/tmp/celeryd-$APPINI.pid" CONF_FILE="$HOME/$APPINI" COMMAND="paster celeryd $CONF_FILE --pidfile=$PIDFILE" if [ -z "$GROUP" ]; then exec sudo -u $USER $COMMAND else exec sudo -u $USER -g $GROUP $COMMAND fi end script post-stop script PIDFILE="/tmp/celeryd-$APPINI.pid" rm -f $PIDFILE end script