11#! /bin/bash
22#
33# GitLab
4- # Maintainer: @elvanja, @troyanov
5- # App Version: 4.0
4+ # Maintainer: @elvanja, @troyanov, @eiyaya
5+ # App Version: 4.1
66
77# chkconfig: 2345 82 55
88# processname: unicorn
9- # processname: rescue
10- # description: Runs unicorn and resque for nginx integration.
9+ # processname: sidekiq
10+ # description: Runs unicorn and sidekiq for nginx integration.
1111
1212# Related (kudos @4sak3n0ne):
1313# https://github.com/gitlabhq/gitlabhq/issues/1049#issuecomment-8386882
@@ -23,17 +23,17 @@ NAME=gitlab
2323USER=$NAME
2424APP_PATH=/home/$USER /gitlab
2525
26- # The PID and LOCK files used by unicorn and resque
26+ # The PID and LOCK files used by unicorn and sidekiq
2727UPID=$APP_PATH /tmp/pids/unicorn.pid
2828ULOCK=/var/lock/subsys/unicorn
29- RPID =$APP_PATH /tmp/pids/resque_worker .pid
30- RLOCK =/var/lock/subsys/resque
29+ SPID =$APP_PATH /tmp/pids/sidekiq .pid
30+ SLOCK =/var/lock/subsys/sidekiq
3131
3232# The options to use when running unicorn
3333OPTS=" -c $APP_PATH /config/unicorn.rb -E production -D"
3434
3535# Ruby related path update
36- RUBY_PATH_PATCH=" PATH=$PATH :/usr/local/bin:/usr/local/lib && export PATH && "
36+ RUBY_PATH_PATCH=" PATH=$PATH :/usr/local/bin:/usr/local/lib:/home/gitlab/bin && export PATH && "
3737
3838start () {
3939 cd $APP_PATH
@@ -45,14 +45,14 @@ start() {
4545 [ $unicorn -eq 0 ] && touch $ULOCK
4646 echo
4747
48- # Start resque
49- echo -n $" Starting resque : "
50- daemon --pidfile=$RPID --user=$USER " $RUBY_PATH_PATCH ./resque.sh "
51- resque =$?
52- [ $resque -eq 0 ] && touch $RLOCK
48+ # Start sidekiq
49+ echo -n $" Starting sidekiq : "
50+ daemon --pidfile=$SPID --user=$USER " $RUBY_PATH_PATCH RAILS_ENV=production bundle exec rake sidekiq:start "
51+ sidekiq =$?
52+ [ $sidekiq -eq 0 ] && touch $SLOCK
5353 echo
5454
55- retval=$unicorn || $resque
55+ retval=$unicorn || $sidekiq
5656 return $retval
5757}
5858
@@ -66,14 +66,14 @@ stop() {
6666 [ $unicorn -eq 0 ] && rm -f $ULOCK
6767 echo
6868
69- # Stop resque
70- echo -n $" Stopping resque : "
71- killproc -p $RPID
72- resque =$?
73- [ $resque -eq 0 ] && rm -f $RLOCK
69+ # Stop sidekiq
70+ echo -n $" Stopping sidekiq : "
71+ killproc -p $SPID
72+ sidekiq =$?
73+ [ $sidekiq -eq 0 ] && rm -f $SLOCK
7474 echo
7575
76- retval=$unicorn || $resque
76+ retval=$unicorn || $sidekiq
7777 return $retval
7878}
7979
@@ -84,7 +84,7 @@ restart() {
8484
8585get_status () {
8686 status -p $UPID unicorn
87- status -p $RPID resque
87+ status -p $SPID sidekiq
8888}
8989
9090query_status () {
@@ -113,4 +113,4 @@ case "$1" in
113113 ;;
114114esac
115115
116- exit 0
116+ exit 0
0 commit comments