CC-2888: Create a monit file for each airtime component
This commit is contained in:
parent
3f1ea46d3d
commit
974612badf
17 changed files with 100 additions and 16 deletions
|
@ -50,6 +50,10 @@ def is_natty():
|
|||
return True
|
||||
return False
|
||||
|
||||
def copy_monit_file(current_script_dir):
|
||||
shutil.copy("%s/../monit-airtime-playout.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/monit-airtime-generic.cfg"%current_script_dir, "/etc/monit/conf.d/")
|
||||
|
||||
try:
|
||||
# load config file
|
||||
|
@ -61,6 +65,8 @@ try:
|
|||
|
||||
current_script_dir = get_current_script_dir()
|
||||
|
||||
copy_monit_file(current_script_dir)
|
||||
|
||||
p = Popen("/etc/init.d/airtime-playout stop >/dev/null 2>&1", shell=True)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
|
||||
|
|
|
@ -17,6 +17,10 @@ def get_current_script_dir():
|
|||
current_script_dir = os.path.realpath(__file__)
|
||||
index = current_script_dir.rindex('/')
|
||||
return current_script_dir[0:index]
|
||||
|
||||
def remove_monit_file():
|
||||
os.system("rm -f /etc/monit/conf.d/monit-airtime-playout.cfg")
|
||||
os.system("rm -f /etc/monit/conf.d/monit-airtime-liquidsoap.cfg")
|
||||
|
||||
try:
|
||||
# load config file
|
||||
|
@ -30,8 +34,11 @@ try:
|
|||
os.system("rm -f /etc/init.d/airtime-playout")
|
||||
os.system("update-rc.d -f airtime-playout remove >/dev/null 2>&1")
|
||||
|
||||
#copy logrotate script
|
||||
#remove logrotate script
|
||||
os.system("rm -f /etc/logrotate.d/airtime-liquidsoap")
|
||||
|
||||
print "Removing monit file"
|
||||
remove_monit_file()
|
||||
|
||||
print "Removing cache directories"
|
||||
remove_path(config["cache_base_dir"])
|
||||
|
|
9
python_apps/pypo/monit-airtime-liquidsoap.cfg
Normal file
9
python_apps/pypo/monit-airtime-liquidsoap.cfg
Normal file
|
@ -0,0 +1,9 @@
|
|||
set daemon 10 # Poll at 5 second intervals
|
||||
set logfile /var/log/monit.log
|
||||
|
||||
set httpd port 2812
|
||||
|
||||
check process airtime-liquidsoap
|
||||
with pidfile "/var/run/airtime-liquidsoap.pid"
|
||||
start program = "/etc/init.d/airtime-playout monit-restart" with timeout 5 seconds
|
||||
stop program = "/etc/init.d/airtime-playout stop"
|
9
python_apps/pypo/monit-airtime-playout.cfg
Normal file
9
python_apps/pypo/monit-airtime-playout.cfg
Normal file
|
@ -0,0 +1,9 @@
|
|||
set daemon 10 # Poll at 5 second intervals
|
||||
set logfile /var/log/monit.log
|
||||
|
||||
set httpd port 2812
|
||||
|
||||
check process airtime-playout
|
||||
with pidfile "/var/run/airtime-playout.pid"
|
||||
start program = "/etc/init.d/airtime-playout monit-restart" with timeout 5 seconds
|
||||
stop program = "/etc/init.d/airtime-playout stop"
|
Loading…
Add table
Add a link
Reference in a new issue