@@ -37,10 +37,9 @@ web_server_pid_path="$pid_path/unicorn.pid"
37
37
sidekiq_pid_path=" $pid_path /sidekiq.pid"
38
38
mail_room_enabled=false
39
39
mail_room_pid_path=" $pid_path /mail_room.pid"
40
- gitlab_git_http_server_pid_path=" $pid_path /gitlab-git-http-server.pid"
41
- gitlab_git_http_server_options=" -listenUmask 0 -listenNetwork unix -listenAddr $socket_path /gitlab-git-http-server.socket -authBackend http://127.0.0.1:8080"
42
- gitlab_git_http_server_repo_root=' /home/git/repositories'
43
- gitlab_git_http_server_log=" $app_root /log/gitlab-git-http-server.log"
40
+ gitlab_workhorse_pid_path=" $pid_path /gitlab-workhorse.pid"
41
+ gitlab_workhorse_options=" -listenUmask 0 -listenNetwork unix -listenAddr $socket_path /gitlab-workhorse.socket -authBackend http://127.0.0.1:8080"
42
+ gitlab_workhorse_log=" $app_root /log/gitlab-workhorse.log"
44
43
shell_path=" /bin/bash"
45
44
46
45
# Read configuration variable file if it is present
@@ -76,8 +75,8 @@ check_pids(){
76
75
else
77
76
spid=0
78
77
fi
79
- if [ -f " $gitlab_git_http_server_pid_path " ]; then
80
- hpid=$( cat " $gitlab_git_http_server_pid_path " )
78
+ if [ -f " $gitlab_workhorse_pid_path " ]; then
79
+ hpid=$( cat " $gitlab_workhorse_pid_path " )
81
80
else
82
81
hpid=0
83
82
fi
@@ -94,7 +93,7 @@ check_pids(){
94
93
wait_for_pids (){
95
94
# We are sleeping a bit here mostly because sidekiq is slow at writing it's pid
96
95
i=0;
97
- while [ ! -f $web_server_pid_path ] || [ ! -f $sidekiq_pid_path ] || [ ! -f $gitlab_git_http_server_pid_path ] || { [ " $mail_room_enabled " = true ] && [ ! -f $mail_room_pid_path ]; }; do
96
+ while [ ! -f $web_server_pid_path ] || [ ! -f $sidekiq_pid_path ] || [ ! -f $gitlab_workhorse_pid_path ] || { [ " $mail_room_enabled " = true ] && [ ! -f $mail_room_pid_path ]; }; do
98
97
sleep 0.1;
99
98
i=$(( i+ 1 ))
100
99
if [ $(( i% 10 )) = 0 ]; then
@@ -131,9 +130,9 @@ check_status(){
131
130
fi
132
131
if [ $hpid -ne 0 ]; then
133
132
kill -0 " $hpid " 2> /dev/null
134
- gitlab_git_http_server_status =" $? "
133
+ gitlab_workhorse_status =" $? "
135
134
else
136
- gitlab_git_http_server_status =" -1"
135
+ gitlab_workhorse_status =" -1"
137
136
fi
138
137
if [ " $mail_room_enabled " = true ]; then
139
138
if [ $mpid -ne 0 ]; then
@@ -143,7 +142,7 @@ check_status(){
143
142
mail_room_status=" -1"
144
143
fi
145
144
fi
146
- if [ $web_status = 0 ] && [ $sidekiq_status = 0 ] && [ $gitlab_git_http_server_status = 0 ] && { [ " $mail_room_enabled " != true ] || [ $mail_room_status = 0 ]; }; then
145
+ if [ $web_status = 0 ] && [ $sidekiq_status = 0 ] && [ $gitlab_workhorse_status = 0 ] && { [ " $mail_room_enabled " != true ] || [ $mail_room_status = 0 ]; }; then
147
146
gitlab_status=0
148
147
else
149
148
# http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
@@ -171,9 +170,9 @@ check_stale_pids(){
171
170
exit 1
172
171
fi
173
172
fi
174
- if [ " $hpid " != " 0" ] && [ " $gitlab_git_http_server_status " != " 0" ]; then
175
- echo " Removing stale gitlab-git-http-server pid. This is most likely caused by gitlab-git-http-server crashing the last time it ran."
176
- if ! rm " $gitlab_git_http_server_pid_path " ; then
173
+ if [ " $hpid " != " 0" ] && [ " $gitlab_workhorse_status " != " 0" ]; then
174
+ echo " Removing stale gitlab-workhorse pid. This is most likely caused by gitlab-workhorse crashing the last time it ran."
175
+ if ! rm " $gitlab_workhorse_pid_path " ; then
177
176
echo " Unable to remove stale pid, exiting"
178
177
exit 1
179
178
fi
@@ -190,7 +189,7 @@ check_stale_pids(){
190
189
# # If no parts of the service is running, bail out.
191
190
exit_if_not_running (){
192
191
check_stale_pids
193
- if [ " $web_status " != " 0" ] && [ " $sidekiq_status " != " 0" ] && [ " $gitlab_git_http_server_status " != " 0" ] && { [ " $mail_room_enabled " != true ] || [ " $mail_room_status " != " 0" ]; }; then
192
+ if [ " $web_status " != " 0" ] && [ " $sidekiq_status " != " 0" ] && [ " $gitlab_workhorse_status " != " 0" ] && { [ " $mail_room_enabled " != true ] || [ " $mail_room_status " != " 0" ]; }; then
194
193
echo " GitLab is not running."
195
194
exit
196
195
fi
@@ -206,8 +205,8 @@ start_gitlab() {
206
205
if [ " $sidekiq_status " != " 0" ]; then
207
206
echo " Starting GitLab Sidekiq"
208
207
fi
209
- if [ " $gitlab_git_http_server_status " != " 0" ]; then
210
- echo " Starting gitlab-git-http-server "
208
+ if [ " $gitlab_workhorse_status " != " 0" ]; then
209
+ echo " Starting gitlab-workhorse "
211
210
fi
212
211
if [ " $mail_room_enabled " = true ] && [ " $mail_room_status " != " 0" ]; then
213
212
echo " Starting GitLab MailRoom"
@@ -230,15 +229,14 @@ start_gitlab() {
230
229
RAILS_ENV=$RAILS_ENV bin/background_jobs start &
231
230
fi
232
231
233
- if [ " $gitlab_git_http_server_status " = " 0" ]; then
234
- echo " The gitlab-git-http-server is already running with pid $spid , not restarting"
232
+ if [ " $gitlab_workhorse_status " = " 0" ]; then
233
+ echo " The gitlab-workhorse is already running with pid $spid , not restarting"
235
234
else
236
- # No need to remove a socket, gitlab-git-http-server does this itself
237
- $app_root /bin/daemon_with_pidfile $gitlab_git_http_server_pid_path \
238
- $app_root /../gitlab-git-http-server/gitlab-git-http-server \
239
- $gitlab_git_http_server_options \
240
- $gitlab_git_http_server_repo_root \
241
- >> $gitlab_git_http_server_log 2>&1 &
235
+ # No need to remove a socket, gitlab-workhorse does this itself
236
+ $app_root /bin/daemon_with_pidfile $gitlab_workhorse_pid_path \
237
+ $app_root /../gitlab-workhorse/gitlab-workhorse \
238
+ $gitlab_workhorse_options \
239
+ >> $gitlab_workhorse_log 2>&1 &
242
240
fi
243
241
244
242
if [ " $mail_room_enabled " = true ]; then
@@ -268,21 +266,21 @@ stop_gitlab() {
268
266
echo " Shutting down GitLab Sidekiq"
269
267
RAILS_ENV=$RAILS_ENV bin/background_jobs stop
270
268
fi
271
- if [ " $gitlab_git_http_server_status " = " 0" ]; then
272
- echo " Shutting down gitlab-git-http-server "
273
- kill -- $( cat $gitlab_git_http_server_pid_path )
269
+ if [ " $gitlab_workhorse_status " = " 0" ]; then
270
+ echo " Shutting down gitlab-workhorse "
271
+ kill -- $( cat $gitlab_workhorse_pid_path )
274
272
fi
275
273
if [ " $mail_room_enabled " = true ] && [ " $mail_room_status " = " 0" ]; then
276
274
echo " Shutting down GitLab MailRoom"
277
275
RAILS_ENV=$RAILS_ENV bin/mail_room stop
278
276
fi
279
277
280
278
# If something needs to be stopped, lets wait for it to stop. Never use SIGKILL in a script.
281
- while [ " $web_status " = " 0" ] || [ " $sidekiq_status " = " 0" ] || [ " $gitlab_git_http_server_status " = " 0" ] || { [ " $mail_room_enabled " = true ] && [ " $mail_room_status " = " 0" ]; }; do
279
+ while [ " $web_status " = " 0" ] || [ " $sidekiq_status " = " 0" ] || [ " $gitlab_workhorse_status " = " 0" ] || { [ " $mail_room_enabled " = true ] && [ " $mail_room_status " = " 0" ]; }; do
282
280
sleep 1
283
281
check_status
284
282
printf " ."
285
- if [ " $web_status " != " 0" ] && [ " $sidekiq_status " != " 0" ] && [ " $gitlab_git_http_server_status " != " 0" ] && { [ " $mail_room_enabled " != true ] || [ " $mail_room_status " != " 0" ]; }; then
283
+ if [ " $web_status " != " 0" ] && [ " $sidekiq_status " != " 0" ] && [ " $gitlab_workhorse_status " != " 0" ] && { [ " $mail_room_enabled " != true ] || [ " $mail_room_status " != " 0" ]; }; then
286
284
printf " \n"
287
285
break
288
286
fi
@@ -292,7 +290,7 @@ stop_gitlab() {
292
290
# Cleaning up unused pids
293
291
rm " $web_server_pid_path " 2> /dev/null
294
292
# rm "$sidekiq_pid_path" 2>/dev/null # Sidekiq seems to be cleaning up it's own pid.
295
- rm -f " $gitlab_git_http_server_pid_path "
293
+ rm -f " $gitlab_workhorse_pid_path "
296
294
if [ " $mail_room_enabled " = true ]; then
297
295
rm " $mail_room_pid_path " 2> /dev/null
298
296
fi
@@ -303,7 +301,7 @@ stop_gitlab() {
303
301
# # Prints the status of GitLab and it's components.
304
302
print_status () {
305
303
check_status
306
- if [ " $web_status " != " 0" ] && [ " $sidekiq_status " != " 0" ] && [ " $gitlab_git_http_server_status " != " 0" ] && { [ " $mail_room_enabled " != true ] || [ " $mail_room_status " != " 0" ]; }; then
304
+ if [ " $web_status " != " 0" ] && [ " $sidekiq_status " != " 0" ] && [ " $gitlab_workhorse_status " != " 0" ] && { [ " $mail_room_enabled " != true ] || [ " $mail_room_status " != " 0" ]; }; then
307
305
echo " GitLab is not running."
308
306
return
309
307
fi
@@ -317,10 +315,10 @@ print_status() {
317
315
else
318
316
printf " The GitLab Sidekiq job dispatcher is \033[31mnot running\033[0m.\n"
319
317
fi
320
- if [ " $gitlab_git_http_server_status " = " 0" ]; then
321
- echo " The gitlab-git-http-server with pid $hpid is running."
318
+ if [ " $gitlab_workhorse_status " = " 0" ]; then
319
+ echo " The gitlab-workhorse with pid $hpid is running."
322
320
else
323
- printf " The gitlab-git-http-server is \033[31mnot running\033[0m.\n"
321
+ printf " The gitlab-workhorse is \033[31mnot running\033[0m.\n"
324
322
fi
325
323
if [ " $mail_room_enabled " = true ]; then
326
324
if [ " $mail_room_status " = " 0" ]; then
@@ -360,7 +358,7 @@ reload_gitlab(){
360
358
# # Restarts Sidekiq and Unicorn.
361
359
restart_gitlab (){
362
360
check_status
363
- if [ " $web_status " = " 0" ] || [ " $sidekiq_status " = " 0" ] || [ " $gitlab_git_http_server " = " 0" ] || { [ " $mail_room_enabled " = true ] && [ " $mail_room_status " = " 0" ]; }; then
361
+ if [ " $web_status " = " 0" ] || [ " $sidekiq_status " = " 0" ] || [ " $gitlab_workhorse " = " 0" ] || { [ " $mail_room_enabled " = true ] && [ " $mail_room_status " = " 0" ]; }; then
364
362
stop_gitlab
365
363
fi
366
364
start_gitlab
0 commit comments