dnsmasq: allow for multiple instances (per libvirt)

We have had a persistent issue of contention with multiple instances
of dnsmasq. When libvirtd is started it will attempt and fail to
create virbr0 that includes a dnsmasq binding (dnsmasq complains that
the port is already in use). The root cause being that the base
dnsmasq configuration uses the 'default' binding, meaning it will be
greedy and bind to all available interfaces, along with any new
interfaces that appear. This prevents any new instances of dnsmasq to
fail. By changing the base dnsmasq configuration to use 'bind-dynamic'
we will be able to create new interfaces and if we want to attach a
new dnsmasq instance for the new interface we can, without contention.

Overall this change should not change the default behavior (other then
fixing the contention) as the 'bind-dynamic' mode will allow the base
config to attach to new interfaces which are not be bound to new
dnsmasq instances.

Removing dnsmasq_exclude_virbr.conf which was a previous (partial)
attempt that was made to resolve this issue.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
This commit is contained in:
Mark Asselstine 2015-09-10 13:59:12 -04:00 committed by Bruce Ashfield
parent 62e49b861f
commit c3c4d977cb
2 changed files with 5 additions and 1 deletions

View File

@ -1 +0,0 @@
except-interface=virbr0

View File

@ -0,0 +1,5 @@
# dnsmasq is greedy with interfaces by default using bind-dynamic will
# make it less greedy but still function as it did by default.
do_install_append() {
sed -i '/#bind-interfaces/a # Play nice with libvirt\nbind-dynamic' ${D}${sysconfdir}/dnsmasq.conf
}