Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

Conflicts:
	airtime_mvc/public/js/airtime/schedule/add-show.js
This commit is contained in:
James 2012-04-05 16:03:15 -04:00
commit 332c1d91b5
9 changed files with 44 additions and 59 deletions

View File

@ -321,7 +321,7 @@ function setAddShowEvents() {
applyPlatformOpacityRules: false applyPlatformOpacityRules: false
}); });
var action = "/Schedule/"+addShowButton.attr("data-action"); var action = "/Schedule/"+String(addShowButton.attr("data-action"));
$.post(action, {format: "json", data: data, hosts: hosts, days: days}, function(json){ $.post(action, {format: "json", data: data, hosts: hosts, days: days}, function(json){
//addShowButton.removeClass("disabled"); //addShowButton.removeClass("disabled");

View File

@ -26,8 +26,7 @@ showhelp () {
--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 --liquidsoap-keep-alive|-l Keep Liquidsoap alive when upgrading"
--disable-auto-start-services|-d Disable auto-starting Airtime services"
} }
overwrite="f" overwrite="f"
@ -39,9 +38,8 @@ pypo="f"
showrecorder="f" showrecorder="f"
web="f" web="f"
liquidsoap_keep_alive="f" liquidsoap_keep_alive="f"
disable_auto_start_services="f"
set -- $(getopt -l help,overwrite,preserve,no-db,reinstall,media-monitor,pypo,show-recorder,web,liquidsoap-keep-alive,disable-auto-start-services "hopnrmyswld" "$@") 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
@ -55,7 +53,6 @@ do
(-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";; (-l|--liquidsoap-keep-alive) liquidsoap_keep_alive="t";;
(-d|--disable-auto-start-services) disable_auto_start_services="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;;
@ -125,14 +122,15 @@ 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"
if [ -e /etc/init.d/airtime-media-monitor ]; then if [ -e /etc/init.d/airtime-media-monitor ]; then
/etc/init.d/airtime-media-monitor stop > /dev/null 2>&1 invoke-rc.d airtime-media-monitor stop > /dev/null 2>&1
fi fi
if [ -e /etc/init.d/airtime-playout ]; then if [ -e /etc/init.d/airtime-playout ]; then
/etc/init.d/airtime-playout stop > /dev/null 2>&1 invoke-rc.d airtime-playout stop > /dev/null 2>&1
fi fi
if [ -e /etc/init.d/airtime-show-recorder ]; then if [ -e /etc/init.d/airtime-show-recorder ]; then
/etc/init.d/airtime-show-recorder stop > /dev/null 2>&1 invoke-rc.d airtime-show-recorder stop > /dev/null 2>&1
fi fi
@ -147,7 +145,6 @@ export nodb
export overwrite export overwrite
export preserve export preserve
export liquidsoap_keep_alive export liquidsoap_keep_alive
export disable_auto_start_services
set +e set +e
test "$mediamonitor" = "t" -o "$pypo" = "t" -o "$showrecorder" = "t" test "$mediamonitor" = "t" -o "$pypo" = "t" -o "$showrecorder" = "t"

View File

@ -46,24 +46,19 @@ fi
# so we can ensure they can register with monit to monitor them when they start. # so we can ensure they can register with monit to monitor them when they start.
# If monit is already running, this step is still useful as we need monit to # If monit is already running, this step is still useful as we need monit to
# reload its config files. # reload its config files.
/etc/init.d/monit restart invoke-rc.d monit restart
#give monit some time to boot-up before issuing commands #give monit some time to boot-up before issuing commands
sleep 1 sleep 1
set +e set +e
if [ "$disable_auto_start_services" = "f" ]; then if [ "$mediamonitor" = "t" ]; then
if [ "$mediamonitor" = "t" ]; then monit monitor airtime-media-monitor
monit monitor airtime-media-monitor fi
fi if [ "$pypo" = "t" ]; then
if [ "$pypo" = "t" ]; then monit monitor airtime-playout
monit monitor airtime-playout monit monitor airtime-liquidsoap
monit monitor airtime-liquidsoap
fi
# if [ "$showrecorder" = "t" ]; then
# monit monitor airtime-show-recorder
# fi
fi fi
monit monitor rabbitmq-server monit monitor rabbitmq-server

View File

@ -50,8 +50,8 @@ try:
#copy monit files #copy monit files
shutil.copy('%s/../../monit/monit-airtime-generic.cfg'%current_script_dir, '/etc/monit/conf.d/') shutil.copy('%s/../../monit/monit-airtime-generic.cfg'%current_script_dir, '/etc/monit/conf.d/')
subprocess.call('sed -i "s/\$admin_pass/%s/g" /etc/monit/conf.d/monit-airtime-generic.cfg' % get_rand_string(), shell=True) subprocess.call('sed -i "s/\$admin_pass/%s/g" /etc/monit/conf.d/monit-airtime-generic.cfg' % get_rand_string(), shell=True)
if os.environ["disable_auto_start_services"] == "f":
shutil.copy('%s/../monit-airtime-media-monitor.cfg'%current_script_dir, '/etc/monit/conf.d/') shutil.copy('%s/../monit-airtime-media-monitor.cfg'%current_script_dir, '/etc/monit/conf.d/')
#create log dir #create log dir
create_dir(config['log_dir']) create_dir(config['log_dir'])

View File

@ -9,18 +9,18 @@ try:
#create media-monitor dir under /var/tmp/airtime #create media-monitor dir under /var/tmp/airtime
if not os.path.exists("/var/tmp/airtime/media-monitor"): if not os.path.exists("/var/tmp/airtime/media-monitor"):
os.makedirs("/var/tmp/airtime/media-monitor") os.makedirs("/var/tmp/airtime/media-monitor")
if os.environ["disable_auto_start_services"] == "f":
#update-rc.d init script
p = Popen("update-rc.d airtime-media-monitor defaults >/dev/null 2>&1", shell=True)
sts = os.waitpid(p.pid, 0)[1]
#Start media-monitor daemon #update-rc.d init script
print "* Waiting for media-monitor processes to start..." p = Popen("update-rc.d airtime-media-monitor defaults >/dev/null 2>&1", shell=True)
""" sts = os.waitpid(p.pid, 0)[1]
p = Popen("/etc/init.d/airtime-media-monitor stop", shell=True)
sts = os.waitpid(p.pid, 0)[1] #Start media-monitor daemon
""" print "* Waiting for media-monitor processes to start..."
p = Popen("/etc/init.d/airtime-media-monitor start-no-monit", shell=True) """
sts = os.waitpid(p.pid, 0)[1] p = Popen("invoke-rc.d airtime-media-monitor stop", shell=True)
sts = os.waitpid(p.pid, 0)[1]
"""
p = Popen("invoke-rc.d airtime-media-monitor start-no-monit", shell=True)
sts = os.waitpid(p.pid, 0)[1]
except Exception, e: except Exception, e:
print e print e

View File

@ -51,9 +51,9 @@ try:
shutil.copy('%s/../../monit/monit-airtime-generic.cfg'%current_script_dir, '/etc/monit/conf.d/') shutil.copy('%s/../../monit/monit-airtime-generic.cfg'%current_script_dir, '/etc/monit/conf.d/')
subprocess.call('sed -i "s/\$admin_pass/%s/g" /etc/monit/conf.d/monit-airtime-generic.cfg' % get_rand_string(), shell=True) subprocess.call('sed -i "s/\$admin_pass/%s/g" /etc/monit/conf.d/monit-airtime-generic.cfg' % get_rand_string(), shell=True)
shutil.copy('%s/../../monit/monit-airtime-rabbitmq-server.cfg'%current_script_dir, '/etc/monit/conf.d/') shutil.copy('%s/../../monit/monit-airtime-rabbitmq-server.cfg'%current_script_dir, '/etc/monit/conf.d/')
if os.environ["disable_auto_start_services"] == "f":
shutil.copy('%s/../monit-airtime-liquidsoap.cfg'%current_script_dir, '/etc/monit/conf.d/') shutil.copy('%s/../monit-airtime-liquidsoap.cfg'%current_script_dir, '/etc/monit/conf.d/')
shutil.copy('%s/../monit-airtime-playout.cfg'%current_script_dir, '/etc/monit/conf.d/') shutil.copy('%s/../monit-airtime-playout.cfg'%current_script_dir, '/etc/monit/conf.d/')
#create pypo log dir #create pypo log dir
create_dir(config['pypo_log_dir']) create_dir(config['pypo_log_dir'])

View File

@ -111,25 +111,18 @@ try:
else: else:
print "Unable to connect to the Airtime server." print "Unable to connect to the Airtime server."
if os.environ["disable_auto_start_services"] == "f": #initialize init.d scripts
#initialize init.d scripts p = Popen("update-rc.d airtime-playout defaults >/dev/null 2>&1", shell=True)
p = Popen("update-rc.d airtime-playout defaults >/dev/null 2>&1", shell=True) sts = os.waitpid(p.pid, 0)[1]
sts = os.waitpid(p.pid, 0)[1]
#restart airtime-playout #clear out an previous pypo cache
print "* Waiting for pypo processes to start..." print "* Clearing previous pypo cache"
""" p = Popen("rm -rf '/var/tmp/airtime/pypo/cache/scheduler/*' >/dev/null 2>&1", 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 > /dev/null 2>&1", shell=True) print "* Waiting for pypo processes to start..."
sts = os.waitpid(p.pid, 0)[1] p = Popen("invoke-rc.d airtime-playout start-no-monit > /dev/null 2>&1", shell=True)
else: sts = os.waitpid(p.pid, 0)[1]
print " * Keeping any previous Liquidsoap instances running"
p = Popen("/etc/init.d/airtime-playout pypo-stop > /dev/null 2>&1", shell=True)
sts = os.waitpid(p.pid, 0)[1]
"""
p = Popen("/etc/init.d/airtime-playout start-no-monit > /dev/null 2>&1", shell=True)
sts = os.waitpid(p.pid, 0)[1]
except Exception, e: except Exception, e:
print e print e

View File

@ -10,7 +10,7 @@ try:
#stop pypo and liquidsoap processes #stop pypo and liquidsoap processes
print "Waiting for pypo processes to stop...", print "Waiting for pypo processes to stop...",
if (os.path.exists('/etc/init.d/airtime-playout')): if (os.path.exists('/etc/init.d/airtime-playout')):
p = Popen("/etc/init.d/airtime-playout stop", shell=True) p = Popen("invoke-rc.d airtime-playout stop", shell=True)
sts = os.waitpid(p.pid, 0)[1] sts = os.waitpid(p.pid, 0)[1]
print "OK" print "OK"
else: else:

View File

@ -30,7 +30,7 @@ try:
print 'Error loading config file: ', e print 'Error loading config file: ', e
sys.exit(1) sys.exit(1)
os.system("/etc/init.d/airtime-playout stop") os.system("invoke-rc.d airtime-playout stop")
os.system("rm -f /etc/init.d/airtime-playout") os.system("rm -f /etc/init.d/airtime-playout")
os.system("update-rc.d -f airtime-playout remove >/dev/null 2>&1") os.system("update-rc.d -f airtime-playout remove >/dev/null 2>&1")