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

This commit is contained in:
James 2012-08-20 17:18:00 -04:00
commit 734be21269
10 changed files with 38 additions and 20 deletions

View File

@ -44,22 +44,24 @@ function generatePartitions(partitions){
function success(data, textStatus, jqXHR){
var services = data.status.services;
for (var key in services){
for (var key in services) {
var s = services[key];
var children = $("#"+s.name).children();
$(children[0]).text(s.name);
var status_class = "not-available-icon";
if (s.status == 0){
status_class = "checked-icon";
} else if (s.status == 1) {
status_class = "warning-icon";
if (s) {
var children = $("#"+s.name).children();
$(children[0]).text(s.name);
var status_class = "not-available-icon";
if (s.status == 0){
status_class = "checked-icon";
} else if (s.status == 1) {
status_class = "warning-icon";
}
$($(children[1]).children()[0]).attr("class", status_class);
$(children[2]).text(sprintf('%(days)sd %(hours)sh %(minutes)sm %(seconds)ss', convertSecondsToDaysHoursMinutesSeconds(s.uptime_seconds)));
$(children[3]).text(s.cpu_perc);
$(children[4]).text(sprintf('%01.1fMB (%s)', parseInt(s.memory_kb)/1000, s.memory_perc));
}
$($(children[1]).children()[0]).attr("class", status_class);
$(children[2]).text(sprintf('%(days)sd %(hours)sh %(minutes)sm %(seconds)ss', convertSecondsToDaysHoursMinutesSeconds(s.uptime_seconds)));
$(children[3]).text(s.cpu_perc);
$(children[4]).text(sprintf('%01.1fMB (%s)', parseInt(s.memory_kb)/1000, s.memory_perc));
}
if (data.status.partitions){
generatePartitions(data.status.partitions);

View File

@ -178,7 +178,7 @@ fi
if [ -e /etc/init.d/airtime-playout ]; then
invoke-rc.d airtime-playout stop > /dev/null 2>&1
fi
if [ -e /etc/init.d/airtime-playout ]; then
if [ -e /etc/init.d/airtime-liquidsoap ]; then
invoke-rc.d airtime-liquidsoap stop > /dev/null 2>&1
fi

View File

@ -25,6 +25,7 @@ chmod 600 /etc/monit/conf.d/monit-airtime-generic.cfg
chmod 600 /etc/monit/conf.d/monit-airtime-liquidsoap.cfg
chmod 600 /etc/monit/conf.d/monit-airtime-media-monitor.cfg
chmod 600 /etc/monit/conf.d/monit-airtime-playout.cfg
chmod 600 /etc/monit/conf.d/monit-airtime-liquidsoap.cfg
chmod 600 /etc/monit/conf.d/monit-airtime-rabbitmq-server.cfg
# Start monit if it is not running, or restart if it is.

View File

@ -1,7 +1,7 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: airtime-playout
# Provides: airtime-liquidsoap
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5

View File

@ -102,6 +102,7 @@ try:
#initialize init.d scripts
subprocess.call("update-rc.d airtime-playout defaults >/dev/null 2>&1", shell=True)
subprocess.call("update-rc.d airtime-liquidsoap defaults >/dev/null 2>&1", shell=True)
#clear out an previous pypo cache
print "* Clearing previous pypo cache"
@ -109,8 +110,8 @@ try:
if "airtime_service_start" in os.environ and os.environ["airtime_service_start"] == "t":
print "* Waiting for pypo processes to start..."
subprocess.call("invoke-rc.d airtime-liquidsoap start-no-monit > /dev/null 2>&1", shell=True)
subprocess.call("invoke-rc.d airtime-playout start-no-monit > /dev/null 2>&1", shell=True)
subprocess.call("invoke-rc.d airtime-liquidsoap start-no-monit > /dev/null 2>&1", shell=True)
except Exception, e:
print e

View File

@ -30,6 +30,7 @@ try:
#remove init.d script
print " * Removing Pypo init.d Script"
remove_file("/etc/init.d/airtime-playout")
remove_file("/etc/init.d/airtime-liquidsoap")
#remove bin, cache, tmp and file dir
print " * Removing Pypo Program Directory"

View File

@ -8,7 +8,7 @@ if os.geteuid() != 0:
try:
#stop pypo and liquidsoap processes
print "Waiting for pypo processes to stop...",
print "Waiting for Pypo process to stop...",
try:
os.remove("/usr/bin/airtime-liquidsoap")
except Exception, e:
@ -18,5 +18,12 @@ try:
print "OK"
else:
print "Wasn't running"
print "Waiting for Liquidsoap process to stop...",
if (os.path.exists('/etc/init.d/airtime-liquidsoap')):
subprocess.call("invoke-rc.d airtime-liquidsoap stop", shell=True)
print "OK"
else:
print "Wasn't running"
except Exception, e:
print e

View File

@ -31,8 +31,13 @@ try:
sys.exit(1)
os.system("invoke-rc.d airtime-playout stop")
os.system("invoke-rc.d airtime-liquidsoap stop")
os.system("rm -f /etc/init.d/airtime-playout")
os.system("rm -f /etc/init.d/airtime-liquidsoap")
os.system("update-rc.d -f airtime-playout remove >/dev/null 2>&1")
os.system("update-rc.d -f airtime-liquidsoap remove >/dev/null 2>&1")
#remove logrotate script
os.system("rm -f /etc/logrotate.d/airtime-liquidsoap")
@ -44,7 +49,7 @@ try:
remove_path(config["cache_base_dir"])
print "Removing symlinks"
os.system("rm -f /usr/bin/airtime-playout")
os.system("rm -f /usr/bin/airtime-liquidsoap")
print "Removing pypo files"
remove_path(config["bin_dir"])

View File

@ -6,4 +6,4 @@
check process airtime-liquidsoap
with pidfile "/var/run/airtime-liquidsoap.pid"
start program = "/etc/init.d/airtime-liquidsoap start" with timeout 5 seconds
stop program = "/etc/init.d/airtime-playout stop"
stop program = "/etc/init.d/airtime-liquidsoap stop"

View File

@ -13,6 +13,7 @@ echo "Are you sure you want to do this? Press Enter to continue..."
read
service airtime-playout stop >/dev/null 2>&1
service airtime-liquidsoap stop >/dev/null 2>&1
service airtime-media-monitor stop >/dev/null 2>&1
service airtime-show-recorder stop >/dev/null 2>&1