View | Details | Raw Unified | Return to bug 23428
Collapse All | Expand All

(-)bind.py (-5 / +8 lines)
 Lines 124-141    Link Here 
124
				if f.endswith('.proxy'):
124
				if f.endswith('.proxy'):
125
					fp.write('include "%s";\n' % os.path.join(named_conf_dir, f))
125
					fp.write('include "%s";\n' % os.path.join(named_conf_dir, f))
126
		fp.close()
126
		fp.close()
127
		univention.debug.debug(univention.debug.LISTENER, univention.debug.INFO, 'DNS: Reloading BIND')
128
		restart=False
127
		restart=False
129
		for file in os.listdir('/var/cache/univention-bind-proxy'):
128
		for zfile in os.listdir('/var/cache/univention-bind-proxy'):
130
			if not os.path.exists(os.path.join('/var/cache/bind', file)):
129
			if not os.path.exists(os.path.join('/var/cache/bind', zfile)):
131
				restart=True
130
				restart=True
132
			else:
131
			else:
133
				zone = file.replace(".zone", "")
132
				zone = zfile.replace(".zone", "")
134
				if os.path.exists('/usr/sbin/rndc'):
133
				if os.path.exists('/usr/sbin/rndc'):
134
					univention.debug.debug(univention.debug.LISTENER, univention.debug.INFO, 'DNS: Reloading BIND')
135
					os.spawnv(os.P_WAIT, '/usr/sbin/rndc', ['rndc', '-p 55555', 'reload', zone])
135
					os.spawnv(os.P_WAIT, '/usr/sbin/rndc', ['rndc', '-p 55555', 'reload', zone])
136
					os.spawnv(os.P_WAIT, '/usr/sbin/rndc', ['rndc', '-p 953', 'reload', zone])
136
					os.spawnv(os.P_WAIT, '/usr/sbin/rndc', ['rndc', '-p 953', 'reload', zone])
137
			os.remove(os.path.join('/var/cache/univention-bind-proxy', file))
137
				else:
138
					univention.debug.debug(univention.debug.LISTENER, univention.debug.ERROR, 'DNS: /usr/sbin/rndc missin, install bind9utils!')
139
			os.remove(os.path.join('/var/cache/univention-bind-proxy', zfile))
138
		if restart:
140
		if restart:
141
			univention.debug.debug(univention.debug.LISTENER, univention.debug.INFO, 'DNS: Restarting BIND')
139
			os.spawnv(os.P_WAIT, '/etc/init.d/univention-bind-proxy', ['univention-bind-proxy', 'restart'])
142
			os.spawnv(os.P_WAIT, '/etc/init.d/univention-bind-proxy', ['univention-bind-proxy', 'restart'])
140
			os.spawnv(os.P_WAIT, '/etc/init.d/univention-bind', ['univention-bind', 'restart'])
143
			os.spawnv(os.P_WAIT, '/etc/init.d/univention-bind', ['univention-bind', 'restart'])
141
144

Return to bug 23428