diff --git a/python_apps/monit/airtime-monit.cfg b/python_apps/monit/airtime-monit.cfg index 22f05e2ca..f09db151d 100644 --- a/python_apps/monit/airtime-monit.cfg +++ b/python_apps/monit/airtime-monit.cfg @@ -1,5 +1,6 @@ set daemon 10 # Poll at 10 second intervals - set logfile syslog facility log_daemon + #set logfile syslog facility log_daemon + set logfile /var/log/monit.log set httpd port 2812 and use address 127.0.0.1 allow localhost @@ -7,16 +8,16 @@ check process airtime-playout with pidfile "/var/run/airtime-playout.pid" - start program = "/etc/init.d/airtime-playout start" with timeout 10 seconds + start program = "/etc/init.d/airtime-playout restart" with timeout 5 seconds stop program = "/etc/init.d/airtime-playout stop" check process airtime-liquidsoap with pidfile "/var/run/airtime-liquidsoap.pid" - start program = "/etc/init.d/airtime-playout start" with timeout 10 seconds + start program = "/etc/init.d/airtime-playout restart" with timeout 5 seconds stop program = "/etc/init.d/airtime-playout stop" -# check process airtime-media-monitor -# with pidfile "/var/run/airtime-media-monitor.pid" -# start program = "/etc/init.d/airtime-media-monitor start" with timeout 10 seconds -# stop program = "/etc/init.d/airtime-media-monitor stop" + check process airtime-media-monitor + with pidfile "/var/run/airtime-media-monitor.pid" + start program = "/etc/init.d/airtime-media-monitor start" with timeout 10 seconds + stop program = "/etc/init.d/airtime-media-monitor stop" check process airtime-show-recorder with pidfile "/var/run/airtime-show-recorder.pid" start program = "/etc/init.d/airtime-show-recorder start" with timeout 10 seconds diff --git a/python_apps/pypo/pypo-cli.py b/python_apps/pypo/pypo-cli.py index 0c9fbb233..c2aeff9db 100755 --- a/python_apps/pypo/pypo-cli.py +++ b/python_apps/pypo/pypo-cli.py @@ -127,15 +127,19 @@ if __name__ == '__main__': q = Queue() pp = PypoPush(q) + pp.daemon = True pp.start() pf = PypoFetch(q) + pf.daemon = True pf.start() - while True: time.sleep(3600) + #while True: time.sleep(3600) #pp.join() - #pf.join() + pf.join() + logger.info("pypo fetch exit") + sys.exit() """ if options.check: try: g.check_schedule() diff --git a/python_apps/pypo/pypofetch.py b/python_apps/pypo/pypofetch.py index 1f4dfd776..2675cd350 100755 --- a/python_apps/pypo/pypofetch.py +++ b/python_apps/pypo/pypofetch.py @@ -199,8 +199,9 @@ class PypoFetch(Thread): # restarting pypo. # we could just restart liquidsoap but it take more time somehow. logger.info("Restarting pypo...") - p = Popen("/etc/init.d/airtime-playout restart >/dev/null 2>&1", shell=True) - sts = os.waitpid(p.pid, 0)[1] + #p = Popen("/etc/init.d/airtime-playout restart >/dev/null 2>&1", shell=True) + #sts = os.waitpid(p.pid, 0)[1] + sys.exit() self.process_schedule(self.schedule_data, "scheduler", False) else: logger.info("No change detected in setting...")