[meta-virtualization] [PATCH] lxc: Make named avoid listening on lxc network interface

zhe.he at windriver.com zhe.he at windriver.com
Tue Sep 11 02:48:09 PDT 2018


From: He Zhe <zhe.he at windriver.com>

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.

Signed-off-by: He Zhe <zhe.he at windriver.com>
---
 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

diff --git a/recipes-core/bind/bind_%.bbappend b/recipes-core/bind/bind_%.bbappend
new file mode 100644
index 0000000..617cacc
--- /dev/null
+++ b/recipes-core/bind/bind_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', '${BPN}_virtualization.inc', '', d)}
diff --git a/recipes-core/bind/bind_virtualization.inc b/recipes-core/bind/bind_virtualization.inc
new file mode 100644
index 0000000..b8f0b3f
--- /dev/null
+++ b/recipes-core/bind/bind_virtualization.inc
@@ -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



More information about the meta-virtualization mailing list