CC-3206: Add ability to do Airtime upgrade without restarting liquidsoap
-done
This commit is contained in:
parent
9bbe1d14fa
commit
76fac6fbef
4 changed files with 31 additions and 13 deletions
|
@ -24,7 +24,7 @@ echo "----------------------------------------------------"
|
||||||
|
|
||||||
dist=`lsb_release -is`
|
dist=`lsb_release -is`
|
||||||
|
|
||||||
if [ "$dist" -eq "Debian" ]; then
|
if [ "$dist" = "Debian" ]; then
|
||||||
grep "deb http://www.debian-multimedia.org squeeze main non-free" /etc/apt/sources.list
|
grep "deb http://www.debian-multimedia.org squeeze main non-free" /etc/apt/sources.list
|
||||||
if [ "$?" -ne "0" ]; then
|
if [ "$?" -ne "0" ]; then
|
||||||
echo "deb http://www.debian-multimedia.org squeeze main non-free" >> /etc/apt/sources.list
|
echo "deb http://www.debian-multimedia.org squeeze main non-free" >> /etc/apt/sources.list
|
||||||
|
|
|
@ -17,15 +17,16 @@ fi
|
||||||
|
|
||||||
showhelp () {
|
showhelp () {
|
||||||
echo "Usage: airtime-install [options]
|
echo "Usage: airtime-install [options]
|
||||||
--help|-h Displays usage information.
|
--help|-h Displays usage information.
|
||||||
--overwrite|-o Overwrite any existing config files.
|
--overwrite|-o Overwrite any existing config files.
|
||||||
--preserve|-p Keep any existing config files.
|
--preserve|-p Keep any existing config files.
|
||||||
--no-db|-n Turn off database install.
|
--no-db|-n Turn off database install.
|
||||||
--reinstall|-r Force a fresh install of this Airtime Version
|
--reinstall|-r Force a fresh install of this Airtime Version
|
||||||
--media-monitor|-m Install only media-monitor
|
--media-monitor|-m Install only media-monitor
|
||||||
--pypo|-p Install only pypo and liquidsoap
|
--pypo|-p Install only pypo and liquidsoap
|
||||||
--show-recorder|-s Install only show-recorder
|
--show-recorder|-s Install only show-recorder
|
||||||
--web|-w Install only files for web-server"
|
--web|-w Install only files for web-server
|
||||||
|
--liquidsoap-keep-alive|-l Keep Liquidsoap alive when upgrading"
|
||||||
}
|
}
|
||||||
|
|
||||||
overwrite="f"
|
overwrite="f"
|
||||||
|
@ -36,8 +37,9 @@ mediamonitor="f"
|
||||||
pypo="f"
|
pypo="f"
|
||||||
showrecorder="f"
|
showrecorder="f"
|
||||||
web="f"
|
web="f"
|
||||||
|
liquidsoap_keep_alive="f"
|
||||||
|
|
||||||
set -- $(getopt -l help,overwrite,preserve,no-db,reinstall,media-monitor,pypo,show-recorder,web "hopnrmysw" "$@")
|
set -- $(getopt -l help,overwrite,preserve,no-db,reinstall,media-monitor,pypo,show-recorder,web,liquidsoap-keep-alive "hopnrmyswl" "$@")
|
||||||
while [ $# -gt 0 ]
|
while [ $# -gt 0 ]
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
@ -50,6 +52,7 @@ do
|
||||||
(-y|--pypo) pypo="t";;
|
(-y|--pypo) pypo="t";;
|
||||||
(-s|--show-recorder) showrecorder="t";;
|
(-s|--show-recorder) showrecorder="t";;
|
||||||
(-w|--web) web="t";;
|
(-w|--web) web="t";;
|
||||||
|
(-l|--liquidsoap-keep-alive) liquidsoap_keep_alive="t";;
|
||||||
|
|
||||||
(--) shift; break;;
|
(--) shift; break;;
|
||||||
(-*) echo "$0: error - unrecognized option $1" 1>&2; exit 1;;
|
(-*) echo "$0: error - unrecognized option $1" 1>&2; exit 1;;
|
||||||
|
@ -103,6 +106,7 @@ export reinstall
|
||||||
export nodb
|
export nodb
|
||||||
export overwrite
|
export overwrite
|
||||||
export preserve
|
export preserve
|
||||||
|
export liquidsoap_keep_alive
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
test "$mediamonitor" = "t" -o "$pypo" = "t" -o "$showrecorder" = "t"
|
test "$mediamonitor" = "t" -o "$pypo" = "t" -o "$showrecorder" = "t"
|
||||||
|
|
|
@ -34,6 +34,14 @@ liquidsoap_stop () {
|
||||||
rm -f $PIDFILE1
|
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 () {
|
||||||
start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID --make-pidfile --pidfile $PIDFILE0 --startas $DAEMON0
|
start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID --make-pidfile --pidfile $PIDFILE0 --startas $DAEMON0
|
||||||
monit monitor airtime-playout >/dev/null 2>&1
|
monit monitor airtime-playout >/dev/null 2>&1
|
||||||
|
|
|
@ -103,8 +103,14 @@ try:
|
||||||
|
|
||||||
#restart airtime-playout
|
#restart airtime-playout
|
||||||
print "* Waiting for pypo processes to start..."
|
print "* Waiting for pypo processes to start..."
|
||||||
p = Popen("/etc/init.d/airtime-playout stop", shell=True)
|
if os.environ["liquidsoap_keep_alive"] == "f":
|
||||||
sts = os.waitpid(p.pid, 0)[1]
|
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)
|
p = Popen("/etc/init.d/airtime-playout start-no-monit", shell=True)
|
||||||
sts = os.waitpid(p.pid, 0)[1]
|
sts = os.waitpid(p.pid, 0)[1]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue