diff --git a/install_full/ubuntu/airtime-full-install b/install_full/ubuntu/airtime-full-install index 30deb8a7e..c33c7b223 100755 --- a/install_full/ubuntu/airtime-full-install +++ b/install_full/ubuntu/airtime-full-install @@ -24,7 +24,7 @@ echo "----------------------------------------------------" 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 if [ "$?" -ne "0" ]; then echo "deb http://www.debian-multimedia.org squeeze main non-free" >> /etc/apt/sources.list diff --git a/install_minimal/airtime-install b/install_minimal/airtime-install index 5895c6bb5..4f2fb73b3 100755 --- a/install_minimal/airtime-install +++ b/install_minimal/airtime-install @@ -17,15 +17,16 @@ fi showhelp () { echo "Usage: airtime-install [options] ---help|-h Displays usage information. ---overwrite|-o Overwrite any existing config files. ---preserve|-p Keep any existing config files. ---no-db|-n Turn off database install. ---reinstall|-r Force a fresh install of this Airtime Version ---media-monitor|-m Install only media-monitor ---pypo|-p Install only pypo and liquidsoap ---show-recorder|-s Install only show-recorder ---web|-w Install only files for web-server" +--help|-h Displays usage information. +--overwrite|-o Overwrite any existing config files. +--preserve|-p Keep any existing config files. +--no-db|-n Turn off database install. +--reinstall|-r Force a fresh install of this Airtime Version +--media-monitor|-m Install only media-monitor +--pypo|-p Install only pypo and liquidsoap +--show-recorder|-s Install only show-recorder +--web|-w Install only files for web-server +--liquidsoap-keep-alive|-l Keep Liquidsoap alive when upgrading" } overwrite="f" @@ -36,8 +37,9 @@ mediamonitor="f" pypo="f" showrecorder="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 ] do case "$1" in @@ -50,6 +52,7 @@ do (-y|--pypo) pypo="t";; (-s|--show-recorder) showrecorder="t";; (-w|--web) web="t";; + (-l|--liquidsoap-keep-alive) liquidsoap_keep_alive="t";; (--) shift; break;; (-*) echo "$0: error - unrecognized option $1" 1>&2; exit 1;; @@ -103,6 +106,7 @@ export reinstall export nodb export overwrite export preserve +export liquidsoap_keep_alive set +e test "$mediamonitor" = "t" -o "$pypo" = "t" -o "$showrecorder" = "t" diff --git a/python_apps/pypo/airtime-playout-init-d b/python_apps/pypo/airtime-playout-init-d index ffa300d1e..44a7e56fb 100755 --- a/python_apps/pypo/airtime-playout-init-d +++ b/python_apps/pypo/airtime-playout-init-d @@ -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 diff --git a/python_apps/pypo/install/pypo-initialize.py b/python_apps/pypo/install/pypo-initialize.py index a70d26b86..5b8044851 100644 --- a/python_apps/pypo/install/pypo-initialize.py +++ b/python_apps/pypo/install/pypo-initialize.py @@ -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]