Skip to contentSkip to conversation

lxc: Make named avoid listening on lxc network interface

PATCH In review [email protected] 2 participants 2 messages Sep 11, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lxc: Make named avoid listening on lxc network interface

From: He Zhe <[email protected]>

lxc-net wants to take care of DNS itself using dnsmasq, while named in bind does the same thing on all network interfaces by default and causes the following error.

dnsmasq: failed to create listening socket for 10.0.3.1: Address already in use Failed to setup lxc-net.

---
 recipes-core/bind/bind_%.bbappend         | 1 +
 recipes-core/bind/bind_virtualization.inc | 4 ++++
 2 files changed, 5 insertions(+)
 create mode 100644 recipes-core/bind/bind_%.bbappend
 create mode 100644 recipes-core/bind/bind_virtualization.inc
recipes-core/bind/bind_%.bbappend new file +1 -0
new file mode 100644
index 0000000..617cacc
@@ -0,0 +1 @@
+require ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', '${BPN}_virtualization.inc', '', d)}
recipes-core/bind/bind_virtualization.inc new file +4 -0
new file mode 100644
index 0000000..b8f0b3f
@@ -0,0 +1,4 @@
+# Tell named not to bother listening on the IP address that lxc handles itself.
+do_install_append() {
+	sed -i -e 's,^\( *options *{\)$,\1\n\t// lxc would take care of this address itself\n\tlisten-on { ! 10.0.3.1; any;};\n,' ${D}${sysconfdir}/bind/named.conf.options
+}
Signature · 1 line
2.7.4
#1 lore raw

merged.

Bruce

Quoted 42 lines · On Tue, Sep 11, 2018 at 5:48 AM, <[email protected]> wrote:

From: He Zhe <[email protected]>

lxc-net wants to take care of DNS itself using dnsmasq, while named in bind does the same thing on all network interfaces by default and causes the following error.

dnsmasq: failed to create listening socket for 10.0.3.1: Address already in use Failed to setup lxc-net.

---
 recipes-core/bind/bind_%.bbappend         | 1 +
 recipes-core/bind/bind_virtualization.inc | 4 ++++
 2 files changed, 5 insertions(+)
 create mode 100644 recipes-core/bind/bind_%.bbappend
 create mode 100644 recipes-core/bind/bind_virtualization.inc
recipes-core/bind/bind_%.bbappend new file +1 -0
new file mode 100644
index 0000000..617cacc
@@ -0,0 +1 @@
+require ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', '${BPN}_virtualization.inc', '', d)}
recipes-core/bind/bind_virtualization.inc new file +4 -1
new file mode 100644
index 0000000..b8f0b3f
@@ -0,0 +1,4 @@
+# Tell named not to bother listening on the IP address that lxc handles itself.
+do_install_append() {
+       sed -i -e 's,^\( *options *{\)$,\1\n\t// lxc would take care of this address itself\n\tlisten-on { ! 10.0.3.1; any;};\n,' ${D}${sysconfdir}/bind/named.conf.options
+}
--

2.7.4

--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"