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.

Signed-off-by: He Zhe <[email protected]>
---
 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

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

Reply via email to