11#! /bin/bash
22#
33# GitLab
4- # Maintainer: @elvanja, @troyanov, @eiyaya, @foyo23
5- # App Version: 5.0 .0
4+ # Maintainer: @elvanja, @troyanov, @eiyaya, @foyo23, @nielsbasjes
5+ # App Version: 5.1 .0
66
77# chkconfig: 2345 82 55
8- # processname: unicorn
8+ # processname: puma
99# processname: sidekiq
10- # description: Runs unicorn and sidekiq for nginx integration.
10+ # description: Runs puma and sidekiq for nginx integration.
1111
1212# Related (kudos @4sak3n0ne):
1313# https://github.com/gitlabhq/gitlabhq/issues/1049#issuecomment-8386882
@@ -23,26 +23,26 @@ NAME=git
2323USER=git
2424APP_PATH=/home/$USER /gitlab
2525
26- # The PID and LOCK files used by unicorn and sidekiq
27- UPID=$APP_PATH /tmp/pids/unicorn .pid
28- ULOCK=/var/lock/subsys/unicorn
26+ # The PID and LOCK files used by puma and sidekiq
27+ UPID=$APP_PATH /tmp/pids/puma .pid
28+ ULOCK=/var/lock/subsys/puma
2929SPID=$APP_PATH /tmp/pids/sidekiq.pid
3030SLOCK=/var/lock/subsys/sidekiq
3131
32- # The options to use when running unicorn
33- OPTS=" -c $APP_PATH /config/unicorn .rb -E production -D "
32+ # The options to use when running puma
33+ OPTS=" -C $APP_PATH /config/puma .rb -e production"
3434
3535# Ruby related path update
3636RUBY_PATH_PATCH=" PATH=$PATH :/usr/local/bin:/usr/local/lib:/home/git/bin && export PATH && "
3737
3838start () {
3939 cd $APP_PATH
4040
41- # Start unicorn
42- echo -n $" Starting unicorn : "
43- daemon --pidfile=$UPID --user=$USER " $RUBY_PATH_PATCH bundle exec unicorn_rails $OPTS "
44- unicorn =$?
45- [ $unicorn -eq 0 ] && touch $ULOCK
41+ # Start puma
42+ echo -n $" Starting puma : "
43+ daemon --pidfile=$UPID --user=$USER " $RUBY_PATH_PATCH bundle exec puma $OPTS "
44+ puma =$?
45+ [ $puma -eq 0 ] && touch $ULOCK
4646 echo
4747
4848 # Start sidekiq
@@ -52,18 +52,18 @@ start() {
5252 [ $sidekiq -eq 0 ] && touch $SLOCK
5353 echo
5454
55- retval=$unicorn || $sidekiq
55+ retval=$puma || $sidekiq
5656 return $retval
5757}
5858
5959stop () {
6060 cd $APP_PATH
6161
62- # Stop unicorn
63- echo -n $" Stopping unicorn : "
62+ # Stop puma
63+ echo -n $" Stopping puma : "
6464 killproc -p $UPID
65- unicorn =$?
66- [ $unicorn -eq 0 ] && rm -f $ULOCK
65+ puma =$?
66+ [ $puma -eq 0 ] && rm -f $ULOCK
6767 echo
6868
6969 # Stop sidekiq
@@ -73,7 +73,7 @@ stop() {
7373 [ $sidekiq -eq 0 ] && rm -f $SLOCK
7474 echo
7575
76- retval=$unicorn || $sidekiq
76+ retval=$puma || $sidekiq
7777 return $retval
7878}
7979
@@ -83,7 +83,7 @@ restart() {
8383}
8484
8585get_status () {
86- status -p $UPID unicorn
86+ status -p $UPID puma
8787 status -p $SPID sidekiq
8888}
8989
@@ -114,3 +114,4 @@ case "$1" in
114114esac
115115
116116exit 0
117+
0 commit comments