CC-2750: Ability to query health status for pypo, liquidsoap, media monitor, and recorder

This commit is contained in:
martin 2011-09-28 12:15:13 -04:00
parent 5418ce4601
commit 1cbc098e91
7 changed files with 45 additions and 10 deletions

View File

@ -42,13 +42,6 @@ elif [ "$result" -ne "0" ]; then
fi
set -e
# Need to ensure monit is running before Airtime daemons are run. This is
# so we can ensure they can register with monit to monitor them when they start.
# If monit is already running, this step is still useful as we need monit to
# reload its config files.
/etc/init.d/monit restart
echo -e "\n*** API Client Installation ***"
python ${SCRIPTPATH}/../python_apps/api_clients/install/api_client_install.py
@ -61,7 +54,18 @@ python ${SCRIPTPATH}/../python_apps/show-recorder/install/recorder-install.py
echo -e "\n*** Media Monitor Installation ***"
python ${SCRIPTPATH}/../python_apps/media-monitor/install/media-monitor-install.py
# Need to ensure monit is running before Airtime daemons are run. This is
# so we can ensure they can register with monit to monitor them when they start.
# If monit is already running, this step is still useful as we need monit to
# reload its config files.
/etc/init.d/monit restart
set +e
monit monitor airtime-media-monitor
monit monitor airtime-liquidsoap
monit monitor airtime-playout
monit monitor airtime-show-recorder
monit monitor rabbitmq-server
set -e

View File

@ -28,6 +28,10 @@ stop () {
rm -f $PIDFILE
}
start_no_monit() {
start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID --make-pidfile --pidfile $PIDFILE --startas $DAEMON
}
case "${1:-''}" in
'start')
@ -49,6 +53,12 @@ case "${1:-''}" in
start
echo "Done."
;;
'start-no-monit')
# restart commands here
echo -n "Starting $NAME: "
start_no_monit
echo "Done."
;;
'status')
# status commands here
/usr/bin/airtime-check-system

View File

@ -78,7 +78,7 @@ try:
sts = os.waitpid(p.pid, 0)[1]
print "Waiting for processes to start..."
p = Popen("/etc/init.d/airtime-media-monitor start", shell=True)
p = Popen("/etc/init.d/airtime-media-monitor start-no-monit", shell=True)
sts = os.waitpid(p.pid, 0)[1]
except Exception, e:

View File

@ -66,6 +66,11 @@ monit_restart() {
}
start_no_monit() {
start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID --make-pidfile --pidfile $PIDFILE0 --startas $DAEMON0
liquidsoap_start
}
case "${1:-''}" in
'start')
# start commands here
@ -86,6 +91,12 @@ case "${1:-''}" in
start
echo "Done."
;;
'start-no-monit')
# restart commands here
echo -n "Starting $NAME: "
start_no_monit
echo "Done."
;;
'monit-restart')
# restart commands here
echo -n "Monit Restarting $NAME: "

View File

@ -153,7 +153,7 @@ try:
else:
print "Unable to connect to the Airtime server."
print "Waiting for processes to start..."
p = Popen("/etc/init.d/airtime-playout start", shell=True)
p = Popen("/etc/init.d/airtime-playout start-no-monit", shell=True)
sts = os.waitpid(p.pid, 0)[1]

View File

@ -29,6 +29,10 @@ stop () {
rm -f $PIDFILE
}
start_no_monit() {
start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID --make-pidfile --pidfile $PIDFILE --startas $DAEMON
}
case "${1:-''}" in
'start')
@ -50,6 +54,12 @@ case "${1:-''}" in
start
echo "Done."
;;
'start-no-monit')
# restart commands here
echo -n "Starting $NAME: "
start_no_monit
echo "Done."
;;
'status')
# status commands here
/usr/bin/airtime-check-system

View File

@ -75,7 +75,7 @@ try:
sts = os.waitpid(p.pid, 0)[1]
print "Waiting for processes to start..."
p = Popen("/etc/init.d/airtime-show-recorder start", shell=True)
p = Popen("/etc/init.d/airtime-show-recorder start-no-monit", shell=True)
sts = os.waitpid(p.pid, 0)[1]
except Exception, e: