CC-3206: Add ability to do Airtime upgrade without restarting liquidsoap

-done
This commit is contained in:
Martin Konecny 2011-12-15 11:16:14 -05:00
parent 9bbe1d14fa
commit 76fac6fbef
4 changed files with 31 additions and 13 deletions

View file

@ -34,6 +34,14 @@ liquidsoap_stop () {
rm -f $PIDFILE1
}
pypo_stop () {
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

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]