2
2
3
3
# GITLAB
4
4
# Maintainer: @randx
5
- # App Version: 5.0
5
+ # App Version: 5.1
6
6
7
7
# ## BEGIN INIT INFO
8
8
# Provides: gitlab
16
16
17
17
18
18
APP_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"
20
20
PID_PATH=" $APP_ROOT /tmp/pids"
21
- UNICORN_PID =" $PID_PATH /unicorn .pid"
21
+ WEB_SERVER_PID =" $PID_PATH /puma .pid"
22
22
SIDEKIQ_PID=" $PID_PATH /sidekiq.pid"
23
23
STOP_SIDEKIQ=" RAILS_ENV=production bundle exec rake sidekiq:stop"
24
24
START_SIDEKIQ=" RAILS_ENV=production bundle exec rake sidekiq:start"
25
- NAME=" unicorn "
25
+ NAME=" gitlab "
26
26
DESC=" Gitlab service"
27
27
28
28
check_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 `
31
31
SPID=` cat $SIDEKIQ_PID `
32
32
STATUS=` ps aux | grep $PID | grep -v grep | wc -l`
33
33
else
@@ -45,7 +45,7 @@ start() {
45
45
exit 1
46
46
else
47
47
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 "
49
49
sudo -u git -H bash -l -c " mkdir -p $PID_PATH && $START_SIDEKIQ > /dev/null 2>&1 &"
50
50
echo " $DESC started"
51
51
fi
@@ -57,9 +57,9 @@ stop() {
57
57
check_pid
58
58
if [ " $PID " -ne 0 -a " $STATUS " -ne 0 ]; then
59
59
# # Program is running, stop it.
60
- kill -QUIT ` cat $UNICORN_PID `
60
+ kill -QUIT ` cat $WEB_SERVER_PID `
61
61
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
63
63
echo " $DESC stopped"
64
64
else
65
65
# # Program is not running, exit with error.
@@ -73,7 +73,7 @@ restart() {
73
73
check_pid
74
74
if [ " $PID " -ne 0 -a " $STATUS " -ne 0 ]; then
75
75
echo " Restarting $DESC ..."
76
- kill -USR2 ` cat $UNICORN_PID `
76
+ kill -USR2 ` cat $WEB_SERVER_PID `
77
77
sudo -u git -H bash -l -c " mkdir -p $PID_PATH && $STOP_SIDEKIQ > /dev/null 2>&1 &"
78
78
if [ ` whoami` = root ]; then
79
79
sudo -u git -H bash -l -c " mkdir -p $PID_PATH && $START_SIDEKIQ > /dev/null 2>&1 &"
0 commit comments