diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-08-19 17:43:24 -0700 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-08-19 17:43:24 -0700 |
commit | 9501495aeb512202dc4ce1a88afb39d66f3d39f1 (patch) | |
tree | 75e2c34f578553d1bc25b9735fa664c51dbaf328 /lib/support/init.d | |
parent | 41fdd20c746f34a02d670dc2784cc279b2478cb7 (diff) | |
download | gitlab-ce-9501495aeb512202dc4ce1a88afb39d66f3d39f1.tar.gz |
Fix init.d script.
Diffstat (limited to 'lib/support/init.d')
-rwxr-xr-x | lib/support/init.d/gitlab | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/support/init.d/gitlab b/lib/support/init.d/gitlab index 3f13dfbfdfc..41a2f254db6 100755 --- a/lib/support/init.d/gitlab +++ b/lib/support/init.d/gitlab @@ -85,7 +85,7 @@ check_pids(){ wait_for_pids(){ # We are sleeping a bit here mostly because sidekiq is slow at writing it's pid i=0; - while [ ! -f $web_server_pid_path ] || [ ! -f $sidekiq_pid_path ] || { [ "$mail_room_enabled" = true ] && [ ! -f $mail_room_pid_path ] }; do + while [ ! -f $web_server_pid_path ] || [ ! -f $sidekiq_pid_path ] || { [ "$mail_room_enabled" = true ] && [ ! -f $mail_room_pid_path ]; }; do sleep 0.1; i=$((i+1)) if [ $((i%10)) = 0 ]; then @@ -128,7 +128,7 @@ check_status(){ mail_room_status="-1" fi fi - if [ $web_status = 0 ] && [ $sidekiq_status = 0 ] && { [ "$mail_room_enabled" != true ] || [ $mail_room_status = 0 ] }; then + if [ $web_status = 0 ] && [ $sidekiq_status = 0 ] && { [ "$mail_room_enabled" != true ] || [ $mail_room_status = 0 ]; }; then gitlab_status=0 else # http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html @@ -168,7 +168,7 @@ check_stale_pids(){ ## If no parts of the service is running, bail out. exit_if_not_running(){ check_stale_pids - if [ "$web_status" != "0" ] && [ "$sidekiq_status" != "0" ] && { [ "$mail_room_enabled" != true ] || [ "$mail_room_status" != "0" ] }; then + if [ "$web_status" != "0" ] && [ "$sidekiq_status" != "0" ] && { [ "$mail_room_enabled" != true ] || [ "$mail_room_status" != "0" ]; }; then echo "GitLab is not running." exit fi @@ -179,13 +179,13 @@ start_gitlab() { check_stale_pids if [ "$web_status" != "0" ]; then - echo -n "Starting GitLab Unicorn" + echo "Starting GitLab Unicorn" fi if [ "$sidekiq_status" != "0" ]; then - echo -n "Starting GitLab Sidekiq" + echo "Starting GitLab Sidekiq" fi if [ "$mail_room_enabled" = true ] && [ "$mail_room_status" != "0" ]; then - echo -n "Starting GitLab MailRoom" + echo "Starting GitLab MailRoom" fi # Then check if the service is running. If it is: don't start again. @@ -225,13 +225,13 @@ stop_gitlab() { exit_if_not_running if [ "$web_status" = "0" ]; then - echo -n "Shutting down GitLab Unicorn" + echo "Shutting down GitLab Unicorn" fi if [ "$sidekiq_status" = "0" ]; then - echo -n "Shutting down GitLab Sidekiq" + echo "Shutting down GitLab Sidekiq" fi if [ "$mail_room_enabled" = true ] && [ "$mail_room_status" = "0" ]; then - echo -n "Shutting down GitLab MailRoom" + echo "Shutting down GitLab MailRoom" fi # If the Unicorn web server is running, tell it to stop; @@ -248,11 +248,11 @@ stop_gitlab() { fi # If something needs to be stopped, lets wait for it to stop. Never use SIGKILL in a script. - while [ "$web_status" = "0" ] || [ "$sidekiq_status" = "0" ] || { [ "$mail_room_enabled" = true ] && [ "$mail_room_status" = "0" ] }; do + while [ "$web_status" = "0" ] || [ "$sidekiq_status" = "0" ] || { [ "$mail_room_enabled" = true ] && [ "$mail_room_status" = "0" ]; }; do sleep 1 check_status printf "." - if [ "$web_status" != "0" ] && [ "$sidekiq_status" != "0" ] && { [ "$mail_room_enabled" != true ] || [ "$mail_room_status" != "0" ] }; then + if [ "$web_status" != "0" ] && [ "$sidekiq_status" != "0" ] && { [ "$mail_room_enabled" != true ] || [ "$mail_room_status" != "0" ]; }; then printf "\n" break fi @@ -272,7 +272,7 @@ stop_gitlab() { ## Prints the status of GitLab and it's components. print_status() { check_status - if [ "$web_status" != "0" ] && [ "$sidekiq_status" != "0" ] && { [ "$mail_room_enabled" != true ] || [ "$mail_room_status" != "0" ] }; then + if [ "$web_status" != "0" ] && [ "$sidekiq_status" != "0" ] && { [ "$mail_room_enabled" != true ] || [ "$mail_room_status" != "0" ]; }; then echo "GitLab is not running." return fi @@ -292,8 +292,8 @@ print_status() { else printf "The GitLab MailRoom email processor is \033[31mnot running\033[0m.\n" fi - end - if [ "$web_status" = "0" ] && [ "$sidekiq_status" = "0" ] && { [ "$mail_room_enabled" != true ] || [ "$mail_room_status" = "0" ] }; then + fi + if [ "$web_status" = "0" ] && [ "$sidekiq_status" = "0" ] && { [ "$mail_room_enabled" != true ] || [ "$mail_room_status" = "0" ]; }; then printf "GitLab and all its components are \033[32mup and running\033[0m.\n" fi } @@ -324,7 +324,7 @@ reload_gitlab(){ ## Restarts Sidekiq and Unicorn. restart_gitlab(){ check_status - if [ "$web_status" = "0" ] || [ "$sidekiq_status" = "0" ] || { [ "$mail_room_enabled" = true ] && [ "$mail_room_status" = "0" ] }; then + if [ "$web_status" = "0" ] || [ "$sidekiq_status" = "0" ] || { [ "$mail_room_enabled" = true ] && [ "$mail_room_status" = "0" ]; }; then stop_gitlab fi start_gitlab |