self._config_writer_cfg_dir = config_dir
self._update = False
self._config_build_templates()
- self._restore()
- # FIXME self._update = True
- #if not self._restore():
- #r = self._restore()
- #print r
- #if not r:
- # self._update = True
+ InitdHandler.__init__(self)
self.host = HostHandler(self)
self.zone = ZoneHandler(self)
self.mx = MailExchangeHandler(self)
delete_zones = list()
for a_zone in self.zones.values():
if a_zone._update or a_zone._add:
- if not a_zone._add:
+ if not a_zone._add and self._service_running:
call(('rndc', 'freeze', a_zone.name))
vars = dict(
zone = a_zone,
self._write_single_config('zoneX.zone',
self._zone_filename(a_zone), vars)
a_zone._update = False
- if not a_zone._add:
+ if not a_zone._add and self._service_running:
call(('rndc', 'thaw', a_zone.name))
else :
self._update = True
if self._update:
self._write_single_config('named.conf')
self._update = False
- self.reload()
+ 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__':