Files @ 3fcb60a152f3
Branch filter:

Location: kallithea/init.d/celeryd-upstart.conf

Mads Kiilerich
controllers: avoid setting constants as controller instance variables in __before__

Setting constants in __before__ is a weird pattern and we can do fine without doing it.
That makes it more clear that there is no state in the controller instances.

Real constants can just be set at the module level.

Some values depend on configuration and can thus probably not be set as
constants at module import time but could perhaps be set in __init__. But
reading configuration directly when needed will probably be just as good.
# celeryd - run the celeryd daemon as an upstart job for kallithea
# Change variables/paths as necessary and place file /etc/init/celeryd.conf
# start/stop/restart as normal upstart job (ie: $ start celeryd)

description     "Celery for Kallithea Mercurial Server"
author          "Matt Zuba <matt.zuba@goodwillaz.org"

start on starting kallithea
stop on stopped kallithea

respawn

umask 0022

env PIDFILE=/tmp/celeryd.pid
env APPINI=/var/hg/kallithea/production.ini
env HOME=/var/hg
env USER=hg
# To use group (if different from user), you must edit sudoers file and change
# root's entry from (ALL) to (ALL:ALL)
# env GROUP=hg

script
    COMMAND="/var/hg/.virtualenvs/kallithea/bin/paster celeryd $APPINI --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
    rm -f $PIDFILE
end script