Skip to content

Commit 9501495

Browse files
author
Douwe Maan
committed
Fix init.d script.
1 parent 41fdd20 commit 9501495

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

lib/support/init.d/gitlab

+15-15
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ check_pids(){
8585
wait_for_pids(){
8686
# We are sleeping a bit here mostly because sidekiq is slow at writing it's pid
8787
i=0;
88-
while [ ! -f $web_server_pid_path ] || [ ! -f $sidekiq_pid_path ] || { [ "$mail_room_enabled" = true ] && [ ! -f $mail_room_pid_path ] }; do
88+
while [ ! -f $web_server_pid_path ] || [ ! -f $sidekiq_pid_path ] || { [ "$mail_room_enabled" = true ] && [ ! -f $mail_room_pid_path ]; }; do
8989
sleep 0.1;
9090
i=$((i+1))
9191
if [ $((i%10)) = 0 ]; then
@@ -128,7 +128,7 @@ check_status(){
128128
mail_room_status="-1"
129129
fi
130130
fi
131-
if [ $web_status = 0 ] && [ $sidekiq_status = 0 ] && { [ "$mail_room_enabled" != true ] || [ $mail_room_status = 0 ] }; then
131+
if [ $web_status = 0 ] && [ $sidekiq_status = 0 ] && { [ "$mail_room_enabled" != true ] || [ $mail_room_status = 0 ]; }; then
132132
gitlab_status=0
133133
else
134134
# http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
@@ -168,7 +168,7 @@ check_stale_pids(){
168168
## If no parts of the service is running, bail out.
169169
exit_if_not_running(){
170170
check_stale_pids
171-
if [ "$web_status" != "0" ] && [ "$sidekiq_status" != "0" ] && { [ "$mail_room_enabled" != true ] || [ "$mail_room_status" != "0" ] }; then
171+
if [ "$web_status" != "0" ] && [ "$sidekiq_status" != "0" ] && { [ "$mail_room_enabled" != true ] || [ "$mail_room_status" != "0" ]; }; then
172172
echo "GitLab is not running."
173173
exit
174174
fi
@@ -179,13 +179,13 @@ start_gitlab() {
179179
check_stale_pids
180180

181181
if [ "$web_status" != "0" ]; then
182-
echo -n "Starting GitLab Unicorn"
182+
echo "Starting GitLab Unicorn"
183183
fi
184184
if [ "$sidekiq_status" != "0" ]; then
185-
echo -n "Starting GitLab Sidekiq"
185+
echo "Starting GitLab Sidekiq"
186186
fi
187187
if [ "$mail_room_enabled" = true ] && [ "$mail_room_status" != "0" ]; then
188-
echo -n "Starting GitLab MailRoom"
188+
echo "Starting GitLab MailRoom"
189189
fi
190190

191191
# Then check if the service is running. If it is: don't start again.
@@ -225,13 +225,13 @@ stop_gitlab() {
225225
exit_if_not_running
226226

227227
if [ "$web_status" = "0" ]; then
228-
echo -n "Shutting down GitLab Unicorn"
228+
echo "Shutting down GitLab Unicorn"
229229
fi
230230
if [ "$sidekiq_status" = "0" ]; then
231-
echo -n "Shutting down GitLab Sidekiq"
231+
echo "Shutting down GitLab Sidekiq"
232232
fi
233233
if [ "$mail_room_enabled" = true ] && [ "$mail_room_status" = "0" ]; then
234-
echo -n "Shutting down GitLab MailRoom"
234+
echo "Shutting down GitLab MailRoom"
235235
fi
236236

237237
# If the Unicorn web server is running, tell it to stop;
@@ -248,11 +248,11 @@ stop_gitlab() {
248248
fi
249249

250250
# If something needs to be stopped, lets wait for it to stop. Never use SIGKILL in a script.
251-
while [ "$web_status" = "0" ] || [ "$sidekiq_status" = "0" ] || { [ "$mail_room_enabled" = true ] && [ "$mail_room_status" = "0" ] }; do
251+
while [ "$web_status" = "0" ] || [ "$sidekiq_status" = "0" ] || { [ "$mail_room_enabled" = true ] && [ "$mail_room_status" = "0" ]; }; do
252252
sleep 1
253253
check_status
254254
printf "."
255-
if [ "$web_status" != "0" ] && [ "$sidekiq_status" != "0" ] && { [ "$mail_room_enabled" != true ] || [ "$mail_room_status" != "0" ] }; then
255+
if [ "$web_status" != "0" ] && [ "$sidekiq_status" != "0" ] && { [ "$mail_room_enabled" != true ] || [ "$mail_room_status" != "0" ]; }; then
256256
printf "\n"
257257
break
258258
fi
@@ -272,7 +272,7 @@ stop_gitlab() {
272272
## Prints the status of GitLab and it's components.
273273
print_status() {
274274
check_status
275-
if [ "$web_status" != "0" ] && [ "$sidekiq_status" != "0" ] && { [ "$mail_room_enabled" != true ] || [ "$mail_room_status" != "0" ] }; then
275+
if [ "$web_status" != "0" ] && [ "$sidekiq_status" != "0" ] && { [ "$mail_room_enabled" != true ] || [ "$mail_room_status" != "0" ]; }; then
276276
echo "GitLab is not running."
277277
return
278278
fi
@@ -292,8 +292,8 @@ print_status() {
292292
else
293293
printf "The GitLab MailRoom email processor is \033[31mnot running\033[0m.\n"
294294
fi
295-
end
296-
if [ "$web_status" = "0" ] && [ "$sidekiq_status" = "0" ] && { [ "$mail_room_enabled" != true ] || [ "$mail_room_status" = "0" ] }; then
295+
fi
296+
if [ "$web_status" = "0" ] && [ "$sidekiq_status" = "0" ] && { [ "$mail_room_enabled" != true ] || [ "$mail_room_status" = "0" ]; }; then
297297
printf "GitLab and all its components are \033[32mup and running\033[0m.\n"
298298
fi
299299
}
@@ -324,7 +324,7 @@ reload_gitlab(){
324324
## Restarts Sidekiq and Unicorn.
325325
restart_gitlab(){
326326
check_status
327-
if [ "$web_status" = "0" ] || [ "$sidekiq_status" = "0" ] || { [ "$mail_room_enabled" = true ] && [ "$mail_room_status" = "0" ] }; then
327+
if [ "$web_status" = "0" ] || [ "$sidekiq_status" = "0" ] || { [ "$mail_room_enabled" = true ] && [ "$mail_room_status" = "0" ]; }; then
328328
stop_gitlab
329329
fi
330330
start_gitlab

0 commit comments

Comments
 (0)