1
1
#! /bin/bash
2
2
#
3
3
# GitLab
4
- # Maintainer: @elvanja, @troyanov
5
- # App Version: 4.0
4
+ # Maintainer: @elvanja, @troyanov, @eiyaya
5
+ # App Version: 4.1
6
6
7
7
# chkconfig: 2345 82 55
8
8
# 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.
11
11
12
12
# Related (kudos @4sak3n0ne):
13
13
# https://github.com/gitlabhq/gitlabhq/issues/1049#issuecomment-8386882
@@ -23,17 +23,17 @@ NAME=gitlab
23
23
USER=$NAME
24
24
APP_PATH=/home/$USER /gitlab
25
25
26
- # The PID and LOCK files used by unicorn and resque
26
+ # The PID and LOCK files used by unicorn and sidekiq
27
27
UPID=$APP_PATH /tmp/pids/unicorn.pid
28
28
ULOCK=/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
31
31
32
32
# The options to use when running unicorn
33
33
OPTS=" -c $APP_PATH /config/unicorn.rb -E production -D"
34
34
35
35
# 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 && "
37
37
38
38
start () {
39
39
cd $APP_PATH
@@ -45,14 +45,14 @@ start() {
45
45
[ $unicorn -eq 0 ] && touch $ULOCK
46
46
echo
47
47
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
53
53
echo
54
54
55
- retval=$unicorn || $resque
55
+ retval=$unicorn || $sidekiq
56
56
return $retval
57
57
}
58
58
@@ -66,14 +66,14 @@ stop() {
66
66
[ $unicorn -eq 0 ] && rm -f $ULOCK
67
67
echo
68
68
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
74
74
echo
75
75
76
- retval=$unicorn || $resque
76
+ retval=$unicorn || $sidekiq
77
77
return $retval
78
78
}
79
79
@@ -84,7 +84,7 @@ restart() {
84
84
85
85
get_status () {
86
86
status -p $UPID unicorn
87
- status -p $RPID resque
87
+ status -p $SPID sidekiq
88
88
}
89
89
90
90
query_status () {
@@ -113,4 +113,4 @@ case "$1" in
113
113
;;
114
114
esac
115
115
116
- exit 0
116
+ exit 0
0 commit comments