~james-page/ubuntu/natty/cobbler/fix-764391

« back to all changes in this revision

Viewing changes to debian/patches/40_ubuntu_bind9_management.patch

  • Committer: James Page
  • Date: 2011-04-18 10:31:54 UTC
  • Revision ID: james.page@canonical.com-20110418103154-hlxha02vd2o0h3dg
* Fixed management of bind9 (LP: #764391):
  - debian/patches/40_ubuntu_bind9_management.patch:
    - Manage bind9 instead of named daemon.
    - Generate configuration in /etc/bind.
    - Use default bind9 configuration as much as possible.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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>
 
7
Forwarded: not-needed
 
8
 
 
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
 
13
@@ -1,31 +1,14 @@
 
14
-options {
 
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; };
 
21
-          recursion yes;
 
22
-};
 
23
-
 
24
-logging {
 
25
-        channel default_debug {
 
26
-                file "data/named.run";
 
27
-                severity dynamic;
 
28
-        };
 
29
-};
 
30
-
 
31
 #for $zone in $forward_zones
 
32
 zone "${zone}." {
 
33
     type master;
 
34
-    file "$zone";
 
35
+    file "/etc/bind/db.$zone";
 
36
 };
 
37
 
 
38
 #end for
 
39
 #for $zone, $arpa in $reverse_zones
 
40
 zone "${arpa}." {
 
41
     type master;
 
42
-    file "$zone";
 
43
+    file "/etc/bind/db.$zone";
 
44
 };
 
45
 
 
46
 #end for
 
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
 
51
@@ -180,7 +180,7 @@
 
52
         """
 
53
         Write out the named.conf main config file from the template.
 
54
         """
 
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
 
60
@@ -291,7 +291,7 @@
 
61
 
 
62
             metadata['host_record'] = self.__pretty_print_host_records(hosts)
 
63
 
 
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)
 
69
@@ -313,7 +313,7 @@
 
70
 
 
71
             metadata['host_record'] = self.__pretty_print_host_records(hosts, rectype='PTR')
 
72
 
 
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
 
82
@@ -66,7 +66,7 @@
 
83
            mode = self.config.api.get_sync().dns.what()
 
84
            if mode == "bind":
 
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
 
95
@@ -53,7 +53,7 @@
 
96
 
 
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: