Commit 4a715c73608012f879671351254bbe3480237404

Authored by Dmitriy Zaporozhets
2 parents ff7073ac 4727fa3f

Merge branch 'init_exit_status' of /home/git/repositories/gitlab/gitlabhq

Showing 1 changed file with 8 additions and 0 deletions   Show diff stats
lib/support/init.d/gitlab
@@ -102,6 +102,13 @@ check_status(){ @@ -102,6 +102,13 @@ check_status(){
102 else 102 else
103 sidekiq_status="-1" 103 sidekiq_status="-1"
104 fi 104 fi
  105 + if [ $web_status = 0 -a $sidekiq_status = 0 ]; then
  106 + gitlab_status=0
  107 + else
  108 + # http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
  109 + # code 3 means 'program is not running'
  110 + gitlab_status=3
  111 + fi
105 } 112 }
106 113
107 ## Check for stale pids and remove them if necessary. 114 ## Check for stale pids and remove them if necessary.
@@ -275,6 +282,7 @@ case "$1" in @@ -275,6 +282,7 @@ case "$1" in
275 ;; 282 ;;
276 status) 283 status)
277 print_status 284 print_status
  285 + exit $gitlab_status
278 ;; 286 ;;
279 *) 287 *)
280 echo "Usage: service gitlab {start|stop|restart|reload|status}" 288 echo "Usage: service gitlab {start|stop|restart|reload|status}"