Skip to content

Commit 3a4bc94

Browse files
committed
change resque to sidekiq, for gitlab 4.1
1 parent 27a48f2 commit 3a4bc94

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

init.d/gitlab-centos

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
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
99
# processname: rescue
10-
# description: Runs unicorn and resque for nginx integration.
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
2323
USER=$NAME
2424
APP_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
2727
UPID=$APP_PATH/tmp/pids/unicorn.pid
2828
ULOCK=/var/lock/subsys/unicorn
29-
RPID=$APP_PATH/tmp/pids/resque_worker.pid
30-
RLOCK=/var/lock/subsys/resque
29+
RPID=$APP_PATH/tmp/pids/sidekiq.pid
30+
RLOCK=/var/lock/subsys/sidekiq
3131

3232
# The options to use when running unicorn
3333
OPTS="-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

3838
start() {
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=$RPID --user=$USER "$RUBY_PATH_PATCH RAILS_ENV=production bundle exec rake sidekiq:start"
51+
sidekiq=$?
52+
[ $sidekiq -eq 0 ] && touch $RLOCK
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: "
69+
# Stop sidekiq
70+
echo -n $"Stopping sidekiq: "
7171
killproc -p $RPID
72-
resque=$?
73-
[ $resque -eq 0 ] && rm -f $RLOCK
72+
sidekiq=$?
73+
[ $sidekiq -eq 0 ] && rm -f $RLOCK
7474
echo
7575

76-
retval=$unicorn || $resque
76+
retval=$unicorn || $sidekiq
7777
return $retval
7878
}
7979

@@ -84,7 +84,7 @@ restart() {
8484

8585
get_status() {
8686
status -p $UPID unicorn
87-
status -p $RPID resque
87+
status -p $RPID sidekiq
8888
}
8989

9090
query_status() {
@@ -113,4 +113,4 @@ case "$1" in
113113
;;
114114
esac
115115

116-
exit 0
116+
exit 0

0 commit comments

Comments
 (0)