Merge branch '2.3.x' into 2.3.x-saas
This commit is contained in:
commit
10fb9c9165
|
@ -143,6 +143,11 @@ fi
|
||||||
#We don't want any of our python services running if we are doing an upgrade/reinstall.
|
#We don't want any of our python services running if we are doing an upgrade/reinstall.
|
||||||
#They will be automatically restarted later on.
|
#They will be automatically restarted later on.
|
||||||
echo "* Temporarily stopping any previous running services"
|
echo "* Temporarily stopping any previous running services"
|
||||||
|
set +e
|
||||||
|
monit unmonitor airtime-media-monitor >/dev/null 2>&1
|
||||||
|
monit unmonitor airtime-liquidsoap >/dev/null 2>&1
|
||||||
|
monit unmonitor airtime-playout >/dev/null 2>&1
|
||||||
|
set -e
|
||||||
if [ -e /etc/init.d/airtime-media-monitor ]; then
|
if [ -e /etc/init.d/airtime-media-monitor ]; then
|
||||||
invoke-rc.d airtime-media-monitor stop > /dev/null 2>&1
|
invoke-rc.d airtime-media-monitor stop > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
@ -172,6 +177,8 @@ set -e
|
||||||
|
|
||||||
echo -e "\n******************************** Install Begin *********************************"
|
echo -e "\n******************************** Install Begin *********************************"
|
||||||
rm -rf "/usr/lib/airtime"
|
rm -rf "/usr/lib/airtime"
|
||||||
|
mkdir -p /usr/lib/airtime
|
||||||
|
|
||||||
if [ "$python_service" -eq "0" ]; then
|
if [ "$python_service" -eq "0" ]; then
|
||||||
$AIRTIMEROOT/python_apps/python-virtualenv/virtualenv-install.sh
|
$AIRTIMEROOT/python_apps/python-virtualenv/virtualenv-install.sh
|
||||||
|
|
||||||
|
@ -208,6 +215,7 @@ if [ "$mediamonitor" = "t" -o "$pypo" = "t" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
#An attempt to force apache to realize that files are updated on upgrade...
|
||||||
touch /usr/share/airtime/public/index.php
|
touch /usr/share/airtime/public/index.php
|
||||||
|
|
||||||
if [ "$python_service" -eq "0" ]; then
|
if [ "$python_service" -eq "0" ]; then
|
||||||
|
|
|
@ -72,7 +72,6 @@ if [ "$python_service" -eq "0" ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p /usr/lib/airtime
|
|
||||||
cp -R $AIRTIMEROOT/utils /usr/lib/airtime
|
cp -R $AIRTIMEROOT/utils /usr/lib/airtime
|
||||||
cp -R $AIRTIMEROOT/python_apps/std_err_override /usr/lib/airtime
|
cp -R $AIRTIMEROOT/python_apps/std_err_override /usr/lib/airtime
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ require_once(__DIR__.'/airtime-constants.php');
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
$iniExists = file_exists("/etc/airtime/airtime.conf");
|
$iniExists = file_exists("/etc/airtime/airtime.conf");
|
||||||
if ($iniExists){
|
if ($iniExists) {
|
||||||
//reinstall, Will ask if we should rewrite config files.
|
//reinstall, Will ask if we should rewrite config files.
|
||||||
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php');
|
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php');
|
||||||
$CC_CONFIG = Config::getConfig();
|
$CC_CONFIG = Config::getConfig();
|
||||||
|
|
|
@ -21,13 +21,9 @@ monit unmonitor airtime-liquidsoap >/dev/null 2>&1
|
||||||
monit unmonitor airtime-playout >/dev/null 2>&1
|
monit unmonitor airtime-playout >/dev/null 2>&1
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
#virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
|
||||||
#. ${virtualenv_bin}activate
|
|
||||||
|
|
||||||
#uninitialize Airtime services
|
#uninitialize Airtime services
|
||||||
python $AIRTIMEROOT/python_apps/pypo/install/pypo-uninitialize.py
|
python $AIRTIMEROOT/python_apps/pypo/install/pypo-uninitialize.py
|
||||||
python $AIRTIMEROOT/python_apps/media-monitor/install/media-monitor-uninitialize.py
|
python $AIRTIMEROOT/python_apps/media-monitor/install/media-monitor-uninitialize.py
|
||||||
#python $AIRTIMEROOT/python_apps/show-recorder/install/recorder-uninitialize.py
|
|
||||||
|
|
||||||
if [ "$purge" = "t" ]; then
|
if [ "$purge" = "t" ]; then
|
||||||
#call Airtime uninstall script
|
#call Airtime uninstall script
|
||||||
|
|
|
@ -15,6 +15,7 @@ NAME="Liquidsoap Playout Engine"
|
||||||
|
|
||||||
DAEMON=/usr/lib/airtime/pypo/bin/airtime-liquidsoap
|
DAEMON=/usr/lib/airtime/pypo/bin/airtime-liquidsoap
|
||||||
PIDFILE=/var/run/airtime-liquidsoap.pid
|
PIDFILE=/var/run/airtime-liquidsoap.pid
|
||||||
|
EXEC='/usr/bin/airtime-liquidsoap'
|
||||||
|
|
||||||
start () {
|
start () {
|
||||||
chown pypo:pypo /var/log/airtime/pypo
|
chown pypo:pypo /var/log/airtime/pypo
|
||||||
|
@ -24,8 +25,10 @@ start () {
|
||||||
touch $PIDFILE
|
touch $PIDFILE
|
||||||
chown pypo:pypo $PIDFILE
|
chown pypo:pypo $PIDFILE
|
||||||
|
|
||||||
|
#start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
|
||||||
|
#--pidfile $PIDFILE --nicelevel -15 --startas $DAEMON
|
||||||
start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
|
start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
|
||||||
--pidfile $PIDFILE --nicelevel -15 --startas $DAEMON
|
--nicelevel -15 --startas $DAEMON --exec $EXEC
|
||||||
}
|
}
|
||||||
|
|
||||||
stop () {
|
stop () {
|
||||||
|
@ -33,9 +36,11 @@ stop () {
|
||||||
timeout -s9 10s /usr/lib/airtime/airtime_virtualenv/bin/python \
|
timeout -s9 10s /usr/lib/airtime/airtime_virtualenv/bin/python \
|
||||||
/usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_prepare_terminate.py
|
/usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_prepare_terminate.py
|
||||||
# Send TERM after 5 seconds, wait at most 30 seconds.
|
# Send TERM after 5 seconds, wait at most 30 seconds.
|
||||||
start-stop-daemon --stop --oknodo --retry=TERM/10/KILL/5 --quiet --pidfile $PIDFILE
|
#start-stop-daemon --stop --oknodo --retry=TERM/10/KILL/5 --quiet --pidfile $PIDFILE
|
||||||
|
start-stop-daemon --stop --oknodo --retry=TERM/10/KILL/5 --quiet --exec $EXEC
|
||||||
|
|
||||||
rm -f $PIDFILE
|
rm -f $PIDFILE
|
||||||
sleep 3
|
sleep 2
|
||||||
}
|
}
|
||||||
|
|
||||||
start_with_monit () {
|
start_with_monit () {
|
||||||
|
|
|
@ -192,6 +192,7 @@ def check_dj_client(user,password) =
|
||||||
ret = get_process_lines("python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_auth.py --dj #{user} #{password}")
|
ret = get_process_lines("python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_auth.py --dj #{user} #{password}")
|
||||||
#ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ...
|
#ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ...
|
||||||
hd = list.hd(ret)
|
hd = list.hd(ret)
|
||||||
|
log("Live DJ authenticated: #{hd}")
|
||||||
hd == "True"
|
hd == "True"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
|
|
||||||
set httpd port 2812
|
set httpd port 2812
|
||||||
|
|
||||||
check process airtime-liquidsoap
|
check process airtime-liquidsoap matching "airtime-liquidsoap.*airtime.*ls_script"
|
||||||
with pidfile "/var/run/airtime-liquidsoap.pid"
|
|
||||||
start program = "/etc/init.d/airtime-liquidsoap start" with timeout 30 seconds
|
start program = "/etc/init.d/airtime-liquidsoap start" with timeout 30 seconds
|
||||||
stop program = "/etc/init.d/airtime-liquidsoap stop"
|
stop program = "/etc/init.d/airtime-liquidsoap stop"
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ class PypoFetch(Thread):
|
||||||
tn.write('exit\n')
|
tn.write('exit\n')
|
||||||
tn.read_all()
|
tn.read_all()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
logger.error(str(e))
|
logger.error(traceback.format_exc())
|
||||||
finally:
|
finally:
|
||||||
lock.release()
|
lock.release()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue