comparison init.d/celeryd-upstart.conf @ 1811:58df0b3ed377 beta

Add Celery upstart file and fix post-stop for rhodecode upstart
author Matt Zuba <matt.zuba@goodwillaz.org>
date Wed, 28 Dec 2011 11:21:04 -0700
parents
children 99ad9d0af1a3
comparison
equal deleted inserted replaced
1810:203af05539e0 1811:58df0b3ed377
1 # celeryd - run the celeryd daemon as an upstart job for rhodecode
2 # Change variables/paths as necessary and place file /etc/init/celeryd.conf
3 # start/stop/restart as normal upstart job (ie: $ start celeryd)
4
5 description "Celery for RhodeCode Mercurial Server"
6 author "Matt Zuba <matt.zuba@goodwillaz.org"
7
8 start on starting rhodecode
9 stop on stopped rhodecode
10
11 respawn
12
13 umask 0022
14
15 env PIDFILE=/tmp/celeryd.pid
16 env APPINI=/var/hg/rhodecode/production.ini
17 env HOME=/var/hg
18 env USER=hg
19 # To use group (if different from user), you must edit sudoers file and change
20 # root's entry from (ALL) to (ALL:ALL)
21 # env GROUP=hg
22
23 script
24 COMMAND="/var/hg/.virtualenvs/rhodecode/bin/paster celeryd $APPINI --pidfile=$PIDFILE"
25 if [ -z "$GROUP" ]; then
26 exec sudo -u $USER $COMMAND
27 else
28 exec sudo -u $USER -g $GROUP $COMMAND
29 fi
30 end script
31
32 post-stop script
33 rm -f $PIDFILE
34 end script