Merge lp:~rvb/maas/bug-1066938-rndc2 into lp:maas/trunk
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Raphaël Badin on 2012-10-16 | ||||
| Approved revision: | 1281 | ||||
| Merged at revision: | 1278 | ||||
| Proposed branch: | lp:~rvb/maas/bug-1066938-rndc2 | ||||
| Merge into: | lp:maas/trunk | ||||
| Diff against target: |
100 lines (+34/-2) 4 files modified
etc/celeryconfig_common.py (+3/-0) etc/democeleryconfig_common.py (+5/-0) src/provisioningserver/dns/config.py (+15/-2) src/provisioningserver/dns/tests/test_config.py (+11/-0) |
||||
| To merge this branch: | bzr merge lp:~rvb/maas/bug-1066938-rndc2 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Gavin Panella (community) | 2012-10-16 | Approve on 2012-10-16 | |
|
Review via email:
|
|||
Commit Message
This branch adds the inclusion of the default 'controls' statement so that the init scripts can control the bind server using the default RNDC key from localhost.
= Notes =
It turns out that if not controls statement is provided, "inet 127.0.0.1 port 953 allow { localhost; };" is included silently and this is used by the init scripts to control the bind server. Since MAAS adds a 'controls' statement to control the bind server, we also need to explicitly include the default 'controls' statement.
I've created a package locally and tested this fix:
Without the default 'controls' statement:
$ sudo /etc/init.d/bind9 restart
* Stopping domain name service... bind9 rndc: connect failed: 127.0.0.1#953: connection refused
waiting for pid 14057 to die [ OK ]
* Starting domain name service... bind9 [ OK ]
With the default 'controls' statement:
sudo /etc/init.d/bind9 restart
* Stopping domain name service... bind9 waiting for pid 13819 to die [ OK ]
* Starting domain name service... bind9 [ OK ]
Description of the Change
Include the default 'controls' statement so that the init scripts can control the bind server using the default RNDC key from localhost.
- 1281. By Raphaël Badin on 2012-10-16
-
Improve comment.
| Raphaël Badin (rvb) wrote : | # |
Thanks for the review!
> [1]
>
> > * Stopping domain name service... bind9 rndc: connect failed:
> > 127.0.0.1#953: connection refused waiting for pid 14057 to die
> > [ OK ]
>
> Do you know why it prints OK when it has failed?
Yeah, if stopping bind using a clean rndc command fails, the init script goes for the jugular: http://
> [2]
>
> +# Include the default RNDC controls (default RNDC key on port 953).
> +DNS_DEFAULT_
>
> Why is this in a Celery config file?
Because all of this code is in the provisioningserver code. Basically all the DNS-related is in provisioningserver. Strickly speaking, this set-up stuff is not executed by a task though.
> [3]
>
> +DEFAULT_CONTROLS = """
> +controls {
> + inet 127.0.0.1 port 953 allow { localhost; };
> +};
> +"""
>
> Include a comment here, about what placed it, and why? Also, remove
> leading new-line?
Added a comment, but I'd like to keep the leading new-line because this snippet is used with "content += snippet" and so the leading new-line is a safety net to avoid any change of fucking up the config file.
| Gavin Panella (allenap) wrote : | # |
> > [2]
> >
> > +# Include the default RNDC controls (default RNDC key on port 953).
> > +DNS_DEFAULT_
> >
> > Why is this in a Celery config file?
>
> Because all of this code is in the provisioningserver code.
Precisely. The provisioningserver code has a config file, pserv.yaml.
More configuration options drifting around in semi-related files makes
the software, as a whole, harder to control, to understand, to debug,
to document.


Looks good.
[1]
> * Stopping domain name service... bind9 rndc: connect failed:
> 127.0.0.1#953: connection refused waiting for pid 14057 to die
> [ OK ]
Do you know why it prints OK when it has failed?
[2]
+# Include the default RNDC controls (default RNDC key on port 953). CONTROLS = True
+DNS_DEFAULT_
Why is this in a Celery config file?
[3]
+DEFAULT_CONTROLS = """
+controls {
+ inet 127.0.0.1 port 953 allow { localhost; };
+};
+"""
Include a comment here, about what placed it, and why? Also, remove
leading new-line?