Commit 4727fa3fcce5e42cdbd1e89e167d674cf23676be
1 parent
3c113599
Exists in
master
and in
4 other branches
Report application status through init exit code
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}" |