Merge branch 'airtime-2.0.x' of dev.sourcefabric.org:airtime into airtime-2.0.x

This commit is contained in:
James 2011-12-15 16:10:42 -05:00
commit 579484a91c
6 changed files with 40 additions and 16 deletions

View file

@ -34,6 +34,14 @@ liquidsoap_stop () {
rm -f $PIDFILE1
}
stop_pypo () {
monit unmonitor airtime-playout >/dev/null 2>&1
# Send TERM after 5 seconds, wait at most 30 seconds.
start-stop-daemon --stop --oknodo --retry TERM/5/0/30 --quiet --pidfile $PIDFILE0
rm -f $PIDFILE0
}
start () {
start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID --make-pidfile --pidfile $PIDFILE0 --startas $DAEMON0
monit monitor airtime-playout >/dev/null 2>&1
@ -124,6 +132,12 @@ case "${1:-''}" in
start-liquidsoap
echo "Done."
;;
'pypo-stop')
# restart commands here
echo -n "Restarting Pypo: "
stop_pypo
echo "Done."
;;
*) # no parameter specified
echo "Usage: $SELF start|stop|restart|status"
exit 1

View file

@ -103,8 +103,14 @@ try:
#restart airtime-playout
print "* Waiting for pypo processes to start..."
p = Popen("/etc/init.d/airtime-playout stop", shell=True)
sts = os.waitpid(p.pid, 0)[1]
if os.environ["liquidsoap_keep_alive"] == "f":
print " * Restarting any previous Liquidsoap instances"
p = Popen("/etc/init.d/airtime-playout stop", shell=True)
sts = os.waitpid(p.pid, 0)[1]
else:
print " * Keeping any previous Liquidsoap instances running"
p = Popen("/etc/init.d/airtime-playout pypo-stop", shell=True)
sts = os.waitpid(p.pid, 0)[1]
p = Popen("/etc/init.d/airtime-playout start-no-monit", shell=True)
sts = os.waitpid(p.pid, 0)[1]