From 51a8d48b4f723b4e6242c8ef082ef6620e8fc4aa Mon Sep 17 00:00:00 2001 From: Nicolas Emiliani Date: Mon, 12 Nov 2007 10:42:29 -0300 Subject: [PATCH] Hack for DNS timer_handle added. The hack consists in redifinig de timer_handle because the generic one that was used to check if the process was running returned a pid that did not belong with the process wanted (named), that was due to teh fact that named is in a path used to execute an option of the syslog deamon. --- pymin/services/dns/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pymin/services/dns/__init__.py b/pymin/services/dns/__init__.py index 7d09c2f..9324afb 100644 --- a/pymin/services/dns/__init__.py +++ b/pymin/services/dns/__init__.py @@ -162,6 +162,18 @@ class DnsHandler(Restorable, ConfigWriter, InitdHandler, TransactionalHandler, return False # Do reload return True # we don't need to reload + # HACK!!!! + def handle_timer(self): + import subprocess + p = subprocess.Popen(('pgrep', '-f', '/usr/sbin/named'), + stdout=subprocess.PIPE) + pid = p.communicate()[0] + if p.returncode == 0 and len(pid) > 0: + self._service_running = True + else: + self._service_running = False + + if __name__ == '__main__': -- 2.43.0