Commit 5fdcbedab4ea8ea42f60af275aff30d29a84d3e8
1 parent
2e2e0522
Exists in
master
and in
4 other branches
add resque to gitlab service
Showing
2 changed files
with
8 additions
and
3 deletions
Show diff stats
doc/installation.md
... | ... | @@ -256,33 +256,38 @@ Create init script in /etc/init.d/gitlab: |
256 | 256 | NAME=unicorn |
257 | 257 | DESC="Gitlab service" |
258 | 258 | PID=/home/gitlab/gitlab/tmp/pids/unicorn.pid |
259 | + RESQUE_PID=/home/gitlab/gitlab/tmp/pids/resque_worker.pid | |
259 | 260 | |
260 | 261 | case "$1" in |
261 | 262 | start) |
262 | 263 | CD_TO_APP_DIR="cd /home/gitlab/gitlab" |
263 | 264 | START_DAEMON_PROCESS="bundle exec unicorn_rails $DAEMON_OPTS" |
265 | + START_RESQUE_PROCESS="bundle exec unicorn_rails $DAEMON_OPTS" | |
264 | 266 | |
265 | 267 | echo -n "Starting $DESC: " |
266 | 268 | if [ `whoami` = root ]; then |
267 | - sudo -u gitlab sh -c "$CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS" | |
269 | + sudo -u gitlab sh -c "$CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS && START_RESQUE_PROCESS" | |
268 | 270 | else |
269 | - $CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS | |
271 | + $CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS && $START_RESQUE_PROCESS | |
270 | 272 | fi |
271 | 273 | echo "$NAME." |
272 | 274 | ;; |
273 | 275 | stop) |
274 | 276 | echo -n "Stopping $DESC: " |
275 | 277 | kill -QUIT `cat $PID` |
278 | + kill -QUIT `cat $RESQUE_PID` | |
276 | 279 | echo "$NAME." |
277 | 280 | ;; |
278 | 281 | restart) |
279 | 282 | echo -n "Restarting $DESC: " |
280 | 283 | kill -USR2 `cat $PID` |
284 | + kill -USR2 `cat $RESQUE_PID` | |
281 | 285 | echo "$NAME." |
282 | 286 | ;; |
283 | 287 | reload) |
284 | 288 | echo -n "Reloading $DESC configuration: " |
285 | 289 | kill -HUP `cat $PID` |
290 | + kill -HUP `cat $RESQUE_PID` | |
286 | 291 | echo "$NAME." |
287 | 292 | ;; |
288 | 293 | *) | ... | ... |
resque.sh
1 | 1 | mkdir tmp/pids |
2 | -nohup bundle exec rake environment resque:work QUEUE=* RAILS_ENV=production PIDFILE=tmp/pids/resque_worker_QUEUE.pid & >> log/resque_worker_QUEUE.log 2>&1 | |
2 | +nohup bundle exec rake environment resque:work QUEUE=* RAILS_ENV=production PIDFILE=tmp/pids/resque_worker.pid & >> log/resque_worker.log 2>&1 | ... | ... |