annotate init.d/celeryd-upstart.conf @ 3181:efe23d6c178c rhodecode-0.0.1.5.2

merged with beta
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 21 Jan 2013 00:49:59 +0100
parents 58df0b3ed377
children 99ad9d0af1a3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1811
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
1 # celeryd - run the celeryd daemon as an upstart job for rhodecode
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
2 # Change variables/paths as necessary and place file /etc/init/celeryd.conf
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
3 # start/stop/restart as normal upstart job (ie: $ start celeryd)
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
4
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
5 description "Celery for RhodeCode Mercurial Server"
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
6 author "Matt Zuba <matt.zuba@goodwillaz.org"
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
7
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
8 start on starting rhodecode
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
9 stop on stopped rhodecode
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
10
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
11 respawn
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
12
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
13 umask 0022
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
14
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
15 env PIDFILE=/tmp/celeryd.pid
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
16 env APPINI=/var/hg/rhodecode/production.ini
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
17 env HOME=/var/hg
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
18 env USER=hg
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
19 # To use group (if different from user), you must edit sudoers file and change
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
20 # root's entry from (ALL) to (ALL:ALL)
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
21 # env GROUP=hg
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
22
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
23 script
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
24 COMMAND="/var/hg/.virtualenvs/rhodecode/bin/paster celeryd $APPINI --pidfile=$PIDFILE"
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
25 if [ -z "$GROUP" ]; then
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
26 exec sudo -u $USER $COMMAND
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
27 else
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
28 exec sudo -u $USER -g $GROUP $COMMAND
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
29 fi
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
30 end script
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
31
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
32 post-stop script
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
33 rm -f $PIDFILE
58df0b3ed377 Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff changeset
34 end script