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,33 +256,38 @@ Create init script in /etc/init.d/gitlab: | ||
| 256 | NAME=unicorn | 256 | NAME=unicorn |
| 257 | DESC="Gitlab service" | 257 | DESC="Gitlab service" |
| 258 | PID=/home/gitlab/gitlab/tmp/pids/unicorn.pid | 258 | PID=/home/gitlab/gitlab/tmp/pids/unicorn.pid |
| 259 | + RESQUE_PID=/home/gitlab/gitlab/tmp/pids/resque_worker.pid | ||
| 259 | 260 | ||
| 260 | case "$1" in | 261 | case "$1" in |
| 261 | start) | 262 | start) |
| 262 | CD_TO_APP_DIR="cd /home/gitlab/gitlab" | 263 | CD_TO_APP_DIR="cd /home/gitlab/gitlab" |
| 263 | START_DAEMON_PROCESS="bundle exec unicorn_rails $DAEMON_OPTS" | 264 | START_DAEMON_PROCESS="bundle exec unicorn_rails $DAEMON_OPTS" |
| 265 | + START_RESQUE_PROCESS="bundle exec unicorn_rails $DAEMON_OPTS" | ||
| 264 | 266 | ||
| 265 | echo -n "Starting $DESC: " | 267 | echo -n "Starting $DESC: " |
| 266 | if [ `whoami` = root ]; then | 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 | else | 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 | fi | 272 | fi |
| 271 | echo "$NAME." | 273 | echo "$NAME." |
| 272 | ;; | 274 | ;; |
| 273 | stop) | 275 | stop) |
| 274 | echo -n "Stopping $DESC: " | 276 | echo -n "Stopping $DESC: " |
| 275 | kill -QUIT `cat $PID` | 277 | kill -QUIT `cat $PID` |
| 278 | + kill -QUIT `cat $RESQUE_PID` | ||
| 276 | echo "$NAME." | 279 | echo "$NAME." |
| 277 | ;; | 280 | ;; |
| 278 | restart) | 281 | restart) |
| 279 | echo -n "Restarting $DESC: " | 282 | echo -n "Restarting $DESC: " |
| 280 | kill -USR2 `cat $PID` | 283 | kill -USR2 `cat $PID` |
| 284 | + kill -USR2 `cat $RESQUE_PID` | ||
| 281 | echo "$NAME." | 285 | echo "$NAME." |
| 282 | ;; | 286 | ;; |
| 283 | reload) | 287 | reload) |
| 284 | echo -n "Reloading $DESC configuration: " | 288 | echo -n "Reloading $DESC configuration: " |
| 285 | kill -HUP `cat $PID` | 289 | kill -HUP `cat $PID` |
| 290 | + kill -HUP `cat $RESQUE_PID` | ||
| 286 | echo "$NAME." | 291 | echo "$NAME." |
| 287 | ;; | 292 | ;; |
| 288 | *) | 293 | *) |
resque.sh
| 1 | mkdir tmp/pids | 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 |