Report application status through init exit code

This commit is contained in:
Jacob Vosmaer 2013-10-25 11:26:22 +02:00
parent 3c11359910
commit 4727fa3fcc
1 changed files with 8 additions and 0 deletions

View File

@ -102,6 +102,13 @@ check_status(){
else
sidekiq_status="-1"
fi
if [ $web_status = 0 -a $sidekiq_status = 0 ]; then
gitlab_status=0
else
# http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
# code 3 means 'program is not running'
gitlab_status=3
fi
}
## Check for stale pids and remove them if necessary.
@ -275,6 +282,7 @@ case "$1" in
;;
status)
print_status
exit $gitlab_status
;;
*)
echo "Usage: service gitlab {start|stop|restart|reload|status}"