1
Description: Enable management of Ubuntu bind9 with manage_dns setting.
2
- Generate /etc/bind/named.conf.local to plug into the standard Ubuntu bind9
3
install and preserve the bind9 default installation configuration.
4
- Generate /etc/bind/db.$zone to align to bind9 zone file names.
5
- Restart/check bind9 rather than named.
6
Author: James Page <james.page@canonical.com>
9
Index: fix-764391/templates/etc/named.template
10
===================================================================
11
--- fix-764391.orig/templates/etc/named.template 2011-04-18 10:46:43.057345158 +0100
12
+++ fix-764391/templates/etc/named.template 2011-04-18 10:47:23.426906461 +0100
15
- listen-on port 53 { 127.0.0.1; };
16
- directory "/var/named";
17
- dump-file "/var/named/data/cache_dump.db";
18
- statistics-file "/var/named/data/named_stats.txt";
19
- memstatistics-file "/var/named/data/named_mem_stats.txt";
20
- allow-query { localhost; };
25
- channel default_debug {
26
- file "data/named.run";
31
#for $zone in $forward_zones
35
+ file "/etc/bind/db.$zone";
39
#for $zone, $arpa in $reverse_zones
43
+ file "/etc/bind/db.$zone";
47
Index: fix-764391/cobbler/modules/manage_bind.py
48
===================================================================
49
--- fix-764391.orig/cobbler/modules/manage_bind.py 2011-04-18 10:47:46.226932274 +0100
50
+++ fix-764391/cobbler/modules/manage_bind.py 2011-04-18 10:49:00.526931926 +0100
53
Write out the named.conf main config file from the template.
55
- settings_file = "/etc/named.conf"
56
+ settings_file = "/etc/bind/named.conf.local"
57
template_file = "/etc/cobbler/named.template"
58
forward_zones = self.settings.manage_forward_zones
59
reverse_zones = self.settings.manage_reverse_zones
62
metadata['host_record'] = self.__pretty_print_host_records(hosts)
64
- zonefilename='/var/named/' + zone
65
+ zonefilename='/etc/bind/db.' + zone
66
if self.logger is not None:
67
self.logger.info("generating (forward) %s" % zonefilename)
68
self.templar.render(template_data, metadata, zonefilename, None)
71
metadata['host_record'] = self.__pretty_print_host_records(hosts, rectype='PTR')
73
- zonefilename='/var/named/' + zone
74
+ zonefilename='/etc/bind/db.' + zone
75
if self.logger is not None:
76
self.logger.info("generating (reverse) %s" % zonefilename)
77
self.templar.render(template_data, metadata, zonefilename, None)
78
Index: fix-764391/cobbler/action_check.py
79
===================================================================
80
--- fix-764391.orig/cobbler/action_check.py 2011-04-18 10:50:24.566792922 +0100
81
+++ fix-764391/cobbler/action_check.py 2011-04-18 10:50:49.546726457 +0100
83
mode = self.config.api.get_sync().dns.what()
85
self.check_bind_bin(status)
86
- self.check_service(status,"named")
87
+ self.check_service(status,"bind9")
88
elif mode == "dnsmasq" and not self.settings.manage_dhcp:
89
self.check_dnsmasq_bin(status)
90
self.check_service(status,"dnsmasq")
91
Index: fix-764391/cobbler/modules/sync_post_restart_services.py
92
===================================================================
93
--- fix-764391.orig/cobbler/modules/sync_post_restart_services.py 2011-04-18 10:55:38.985302648 +0100
94
+++ fix-764391/cobbler/modules/sync_post_restart_services.py 2011-04-18 10:55:56.105188050 +0100
97
if manage_dns != "0" and restart_dns != "0":
98
if which_dns_module == "manage_bind":
99
- rc = utils.subprocess_call(logger, "service named restart", shell=True)
100
+ rc = utils.subprocess_call(logger, "service bind9 restart", shell=True)
101
elif which_dns_module == "manage_dnsmasq" and not has_restarted_dnsmasq:
102
rc = utils.subprocess_call(logger, "service dnsmasq restart", shell=True)
103
elif which_dns_module == "manage_dnsmasq" and has_restarted_dnsmasq: