22
33# GITLAB
44# Maintainer: @randx
5- # App Version: 5.0
5+ # App Version: 5.1
66
77# ## BEGIN INIT INFO
88# Provides: gitlab
1616
1717
1818APP_ROOT=" /home/git/gitlab"
19- DAEMON_OPTS=" -c $APP_ROOT /config/unicorn .rb -E production"
19+ DAEMON_OPTS=" -C $APP_ROOT /config/puma .rb -E production"
2020PID_PATH=" $APP_ROOT /tmp/pids"
21- UNICORN_PID =" $PID_PATH /unicorn .pid"
21+ WEB_SERVER_PID =" $PID_PATH /puma .pid"
2222SIDEKIQ_PID=" $PID_PATH /sidekiq.pid"
2323STOP_SIDEKIQ=" RAILS_ENV=production bundle exec rake sidekiq:stop"
2424START_SIDEKIQ=" RAILS_ENV=production bundle exec rake sidekiq:start"
25- NAME=" unicorn "
25+ NAME=" gitlab "
2626DESC=" Gitlab service"
2727
2828check_pid (){
29- if [ -f $UNICORN_PID ]; then
30- PID=` cat $UNICORN_PID `
29+ if [ -f $WEB_SERVER_PID ]; then
30+ PID=` cat $WEB_SERVER_PID `
3131 SPID=` cat $SIDEKIQ_PID `
3232 STATUS=` ps aux | grep $PID | grep -v grep | wc -l`
3333 else
@@ -45,7 +45,7 @@ start() {
4545 exit 1
4646 else
4747 if [ ` whoami` = root ]; then
48- sudo -u git -H bash -l -c " nohup bundle exec unicorn_rails $DAEMON_OPTS > /dev/null 2>&1 & "
48+ sudo -u git -H bash -l -c " RAILS_ENV=production bundle exec puma $DAEMON_OPTS "
4949 sudo -u git -H bash -l -c " mkdir -p $PID_PATH && $START_SIDEKIQ > /dev/null 2>&1 &"
5050 echo " $DESC started"
5151 fi
@@ -57,9 +57,9 @@ stop() {
5757 check_pid
5858 if [ " $PID " -ne 0 -a " $STATUS " -ne 0 ]; then
5959 # # Program is running, stop it.
60- kill -QUIT ` cat $UNICORN_PID `
60+ kill -QUIT ` cat $WEB_SERVER_PID `
6161 sudo -u git -H bash -l -c " mkdir -p $PID_PATH && $STOP_SIDEKIQ > /dev/null 2>&1 &"
62- rm " $UNICORN_PID " >> /dev/null
62+ rm " $WEB_SERVER_PID " >> /dev/null
6363 echo " $DESC stopped"
6464 else
6565 # # Program is not running, exit with error.
@@ -73,7 +73,7 @@ restart() {
7373 check_pid
7474 if [ " $PID " -ne 0 -a " $STATUS " -ne 0 ]; then
7575 echo " Restarting $DESC ..."
76- kill -USR2 ` cat $UNICORN_PID `
76+ kill -USR2 ` cat $WEB_SERVER_PID `
7777 sudo -u git -H bash -l -c " mkdir -p $PID_PATH && $STOP_SIDEKIQ > /dev/null 2>&1 &"
7878 if [ ` whoami` = root ]; then
7979 sudo -u git -H bash -l -c " mkdir -p $PID_PATH && $START_SIDEKIQ > /dev/null 2>&1 &"
0 commit comments