1
1
#! /bin/bash
2
2
#
3
3
# 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
6
6
7
7
# chkconfig: 2345 82 55
8
- # processname: unicorn
8
+ # processname: puma
9
9
# processname: sidekiq
10
- # description: Runs unicorn and sidekiq for nginx integration.
10
+ # description: Runs puma and sidekiq for nginx integration.
11
11
12
12
# Related (kudos @4sak3n0ne):
13
13
# https://github.com/gitlabhq/gitlabhq/issues/1049#issuecomment-8386882
@@ -23,26 +23,26 @@ NAME=git
23
23
USER=git
24
24
APP_PATH=/home/$USER /gitlab
25
25
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
29
29
SPID=$APP_PATH /tmp/pids/sidekiq.pid
30
30
SLOCK=/var/lock/subsys/sidekiq
31
31
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"
34
34
35
35
# Ruby related path update
36
36
RUBY_PATH_PATCH=" PATH=$PATH :/usr/local/bin:/usr/local/lib:/home/git/bin && export PATH && "
37
37
38
38
start () {
39
39
cd $APP_PATH
40
40
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
46
46
echo
47
47
48
48
# Start sidekiq
@@ -52,18 +52,18 @@ start() {
52
52
[ $sidekiq -eq 0 ] && touch $SLOCK
53
53
echo
54
54
55
- retval=$unicorn || $sidekiq
55
+ retval=$puma || $sidekiq
56
56
return $retval
57
57
}
58
58
59
59
stop () {
60
60
cd $APP_PATH
61
61
62
- # Stop unicorn
63
- echo -n $" Stopping unicorn : "
62
+ # Stop puma
63
+ echo -n $" Stopping puma : "
64
64
killproc -p $UPID
65
- unicorn =$?
66
- [ $unicorn -eq 0 ] && rm -f $ULOCK
65
+ puma =$?
66
+ [ $puma -eq 0 ] && rm -f $ULOCK
67
67
echo
68
68
69
69
# Stop sidekiq
@@ -73,7 +73,7 @@ stop() {
73
73
[ $sidekiq -eq 0 ] && rm -f $SLOCK
74
74
echo
75
75
76
- retval=$unicorn || $sidekiq
76
+ retval=$puma || $sidekiq
77
77
return $retval
78
78
}
79
79
@@ -83,7 +83,7 @@ restart() {
83
83
}
84
84
85
85
get_status () {
86
- status -p $UPID unicorn
86
+ status -p $UPID puma
87
87
status -p $SPID sidekiq
88
88
}
89
89
@@ -114,3 +114,4 @@ case "$1" in
114
114
esac
115
115
116
116
exit 0
117
+
0 commit comments