@@ -20,6 +20,8 @@ DAEMON_OPTS="-c $APP_ROOT/config/unicorn.rb -E production"
20
20
PID_PATH=" $APP_ROOT /tmp/pids"
21
21
UNICORN_PID=" $PID_PATH /unicorn.pid"
22
22
RESQUE_PID=" $PID_PATH /sidekiq.pid"
23
+ STOP_SIDEKIQ=" RAILS_ENV=production bundle exec rake sidekiq:stop"
24
+ START_SIDEKIQ=" RAILS_ENV=production bundle exec rake sidekiq:start"
23
25
NAME=" unicorn"
24
26
DESC=" Gitlab service"
25
27
@@ -43,7 +45,7 @@ start() {
43
45
else
44
46
if [ ` whoami` = root ]; then
45
47
sudo -u gitlab -H bash -l -c " nohup bundle exec unicorn_rails $DAEMON_OPTS > /dev/null 2>&1 &"
46
- sudo -u gitlab -H bash -l -c " mkdir -p $PID_PATH && RAILS_ENV=production bundle exec rake sidekiq:start > /dev/null 2>&1 &"
48
+ sudo -u gitlab -H bash -l -c " mkdir -p $PID_PATH && $START_SIDEKIQ > /dev/null 2>&1 &"
47
49
echo " $DESC started"
48
50
fi
49
51
fi
@@ -55,7 +57,7 @@ stop() {
55
57
if [ " $PID " -ne 0 -a " $STATUS " -ne 0 ]; then
56
58
# # Program is running, stop it.
57
59
kill -QUIT ` cat $UNICORN_PID `
58
- kill -QUIT ` cat $RESQUE_PID `
60
+ sudo -u gitlab -H bash -l -c " mkdir -p $PID_PATH && $STOP_SIDEKIQ > /dev/null 2>&1 & "
59
61
rm " $UNICORN_PID " >> /dev/null
60
62
rm " $RESQUE_PID " >> /dev/null
61
63
echo " $DESC stopped"
@@ -72,9 +74,9 @@ restart() {
72
74
if [ " $PID " -ne 0 -a " $STATUS " -ne 0 ]; then
73
75
echo " Restarting $DESC ..."
74
76
kill -USR2 ` cat $UNICORN_PID `
75
- kill -QUIT ` cat $RESQUE_PID `
77
+ sudo -u gitlab -H bash -l -c " mkdir -p $PID_PATH && $STOP_SIDEKIQ > /dev/null 2>&1 & "
76
78
if [ ` whoami` = root ]; then
77
- sudo -u gitlab -H bash -l -c " RAILS_ENV=production bundle exec rake sidekiq:start > /dev/null 2>&1 &"
79
+ sudo -u gitlab -H bash -l -c " mkdir -p $PID_PATH && $START_SIDEKIQ > /dev/null 2>&1 &"
78
80
fi
79
81
echo " $DESC restarted."
80
82
else
0 commit comments