Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
734be21269
|
@ -44,22 +44,24 @@ function generatePartitions(partitions){
|
||||||
function success(data, textStatus, jqXHR){
|
function success(data, textStatus, jqXHR){
|
||||||
var services = data.status.services;
|
var services = data.status.services;
|
||||||
|
|
||||||
for (var key in services){
|
for (var key in services) {
|
||||||
var s = services[key];
|
var s = services[key];
|
||||||
var children = $("#"+s.name).children();
|
if (s) {
|
||||||
$(children[0]).text(s.name);
|
var children = $("#"+s.name).children();
|
||||||
|
$(children[0]).text(s.name);
|
||||||
var status_class = "not-available-icon";
|
|
||||||
if (s.status == 0){
|
var status_class = "not-available-icon";
|
||||||
status_class = "checked-icon";
|
if (s.status == 0){
|
||||||
} else if (s.status == 1) {
|
status_class = "checked-icon";
|
||||||
status_class = "warning-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){
|
if (data.status.partitions){
|
||||||
generatePartitions(data.status.partitions);
|
generatePartitions(data.status.partitions);
|
||||||
|
|
|
@ -178,7 +178,7 @@ fi
|
||||||
if [ -e /etc/init.d/airtime-playout ]; then
|
if [ -e /etc/init.d/airtime-playout ]; then
|
||||||
invoke-rc.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-playout ]; then
|
if [ -e /etc/init.d/airtime-liquidsoap ]; then
|
||||||
invoke-rc.d airtime-liquidsoap stop > /dev/null 2>&1
|
invoke-rc.d airtime-liquidsoap stop > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -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-liquidsoap.cfg
|
||||||
chmod 600 /etc/monit/conf.d/monit-airtime-media-monitor.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-playout.cfg
|
||||||
|
chmod 600 /etc/monit/conf.d/monit-airtime-liquidsoap.cfg
|
||||||
chmod 600 /etc/monit/conf.d/monit-airtime-rabbitmq-server.cfg
|
chmod 600 /etc/monit/conf.d/monit-airtime-rabbitmq-server.cfg
|
||||||
|
|
||||||
# Start monit if it is not running, or restart if it is.
|
# Start monit if it is not running, or restart if it is.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: airtime-playout
|
# Provides: airtime-liquidsoap
|
||||||
# Required-Start: $local_fs $remote_fs $network $syslog
|
# Required-Start: $local_fs $remote_fs $network $syslog
|
||||||
# Required-Stop: $local_fs $remote_fs $network $syslog
|
# Required-Stop: $local_fs $remote_fs $network $syslog
|
||||||
# Default-Start: 2 3 4 5
|
# Default-Start: 2 3 4 5
|
||||||
|
|
|
@ -102,6 +102,7 @@ try:
|
||||||
|
|
||||||
#initialize init.d scripts
|
#initialize init.d scripts
|
||||||
subprocess.call("update-rc.d airtime-playout defaults >/dev/null 2>&1", shell=True)
|
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
|
#clear out an previous pypo cache
|
||||||
print "* Clearing 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":
|
if "airtime_service_start" in os.environ and os.environ["airtime_service_start"] == "t":
|
||||||
print "* Waiting for pypo processes to start..."
|
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-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:
|
except Exception, e:
|
||||||
print e
|
print e
|
||||||
|
|
|
@ -30,6 +30,7 @@ try:
|
||||||
#remove init.d script
|
#remove init.d script
|
||||||
print " * Removing Pypo init.d Script"
|
print " * Removing Pypo init.d Script"
|
||||||
remove_file("/etc/init.d/airtime-playout")
|
remove_file("/etc/init.d/airtime-playout")
|
||||||
|
remove_file("/etc/init.d/airtime-liquidsoap")
|
||||||
|
|
||||||
#remove bin, cache, tmp and file dir
|
#remove bin, cache, tmp and file dir
|
||||||
print " * Removing Pypo Program Directory"
|
print " * Removing Pypo Program Directory"
|
||||||
|
|
|
@ -8,7 +8,7 @@ if os.geteuid() != 0:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
#stop pypo and liquidsoap processes
|
#stop pypo and liquidsoap processes
|
||||||
print "Waiting for pypo processes to stop...",
|
print "Waiting for Pypo process to stop...",
|
||||||
try:
|
try:
|
||||||
os.remove("/usr/bin/airtime-liquidsoap")
|
os.remove("/usr/bin/airtime-liquidsoap")
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
@ -18,5 +18,12 @@ try:
|
||||||
print "OK"
|
print "OK"
|
||||||
else:
|
else:
|
||||||
print "Wasn't running"
|
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:
|
except Exception, e:
|
||||||
print e
|
print e
|
||||||
|
|
|
@ -31,8 +31,13 @@ try:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
os.system("invoke-rc.d airtime-playout stop")
|
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-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-playout remove >/dev/null 2>&1")
|
||||||
|
os.system("update-rc.d -f airtime-liquidsoap remove >/dev/null 2>&1")
|
||||||
|
|
||||||
#remove logrotate script
|
#remove logrotate script
|
||||||
os.system("rm -f /etc/logrotate.d/airtime-liquidsoap")
|
os.system("rm -f /etc/logrotate.d/airtime-liquidsoap")
|
||||||
|
@ -44,7 +49,7 @@ try:
|
||||||
remove_path(config["cache_base_dir"])
|
remove_path(config["cache_base_dir"])
|
||||||
|
|
||||||
print "Removing symlinks"
|
print "Removing symlinks"
|
||||||
os.system("rm -f /usr/bin/airtime-playout")
|
os.system("rm -f /usr/bin/airtime-liquidsoap")
|
||||||
|
|
||||||
print "Removing pypo files"
|
print "Removing pypo files"
|
||||||
remove_path(config["bin_dir"])
|
remove_path(config["bin_dir"])
|
||||||
|
|
|
@ -6,4 +6,4 @@
|
||||||
check process airtime-liquidsoap
|
check process airtime-liquidsoap
|
||||||
with pidfile "/var/run/airtime-liquidsoap.pid"
|
with pidfile "/var/run/airtime-liquidsoap.pid"
|
||||||
start program = "/etc/init.d/airtime-liquidsoap start" with timeout 5 seconds
|
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"
|
||||||
|
|
|
@ -13,6 +13,7 @@ echo "Are you sure you want to do this? Press Enter to continue..."
|
||||||
read
|
read
|
||||||
|
|
||||||
service airtime-playout stop >/dev/null 2>&1
|
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-media-monitor stop >/dev/null 2>&1
|
||||||
service airtime-show-recorder stop >/dev/null 2>&1
|
service airtime-show-recorder stop >/dev/null 2>&1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue