@@ -20,6 +20,8 @@ DAEMON_OPTS="-c $APP_ROOT/config/unicorn.rb -E production"
2020PID_PATH=" $APP_ROOT /tmp/pids"
2121UNICORN_PID=" $PID_PATH /unicorn.pid"
2222RESQUE_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"
2325NAME=" unicorn"
2426DESC=" Gitlab service"
2527
@@ -43,7 +45,7 @@ start() {
4345 else
4446 if [ ` whoami` = root ]; then
4547 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 &"
4749 echo " $DESC started"
4850 fi
4951 fi
@@ -55,7 +57,7 @@ stop() {
5557 if [ " $PID " -ne 0 -a " $STATUS " -ne 0 ]; then
5658 # # Program is running, stop it.
5759 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 & "
5961 rm " $UNICORN_PID " >> /dev/null
6062 rm " $RESQUE_PID " >> /dev/null
6163 echo " $DESC stopped"
@@ -72,9 +74,9 @@ restart() {
7274 if [ " $PID " -ne 0 -a " $STATUS " -ne 0 ]; then
7375 echo " Restarting $DESC ..."
7476 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 & "
7678 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 &"
7880 fi
7981 echo " $DESC restarted."
8082 else
0 commit comments