[Pkg-libvirt-maintainers] Bug#504605: Bug#504605: libvirt-bin: README.Debian says dnsmasq should not be already running

Adeodato Simó dato at net.com.org.es
Tue Nov 11 12:21:02 UTC 2008


* Guido Günther [Thu, 06 Nov 2008 09:11:25 +0100]:

> On Wed, Nov 05, 2008 at 05:02:52PM +0100, Adeodato Simó wrote:
> > Package: libvirt-bin
> > Version: 0.4.6-4
> > Severity: normal

> > From /usr/share/doc/libvirt-bin/README.Debian:

> >   | In order for things to work this way you need to have the recommended packages
> >   | dnsmasq, bridge-utils and iptables installed and dnsmasq must not be already
> >   | running since libvirt starts it with the above parameters.

> > In my system dnsmasq was previously installed and running; nevertheless
> > libvirt-bin's own dnsmasq started normally, and served well the guests,
> > because it only listened in the bridge interface.
> This doesn't work here. If I do 

> /etc/init.d/dnsmasq  stop
> virsh net-start default

> I have:
> # ps awux | grep dnsm
> nobody    6327  0.0  0.0   5784  1080 ?        S    08:47   0:00 dnsmasq --keep-in-foreground --strict-order --bind-interfaces --pid-file  --conf-file  --listen-address 192.168.122.1 --except-interface lo --dhcp-leasefile=/var/lib/libvirt/dhcp-default.leases --dhcp-range 192.168.122.2,192.168.122.254

> If I have dnsmasq already running I have:

> # ps awux | grep dnsm
> dnsmasq   6373  0.0  0.0   5780   696 ?        S    08:48   0:00 /usr/sbin/dnsmasq -u dnsmasq -r /var/run/dnsmasq/resolv.conf
> root      6457  0.0  0.0      0     0 ?        Z    08:49   0:00 [dnsmasq] <defunct>

> because (this is what libvirt basically does):

> # brctl addbr virbr0
> # ifconfig virbr0 192.168.122.1
> # dnsmasq --keep-in-foreground --strict-order --bind-interfaces --pid-file  --conf-file  --listen-address 192.168.122.1 --except-interface lo --dhcp-leasefile=/var/lib/libvirt/dhcp-default.leases --dhcp-range 192.168.122.2,192.168.122.254 
> dnsmasq: failed to bind listening socket for 192.168.122.1: Address already in use

> One can partially work around this by using:

> DNSMASQ_OPTS=-z

> in /etc/defaults/dnsmasq but even this only works as long as you don't
> restart dnsmasq. There are two possible solutions I can think of:

> * Using conf-file multiple times and running only one dnsmasq instance
>   per defined libvirt network (we'd need to  restart the daemon when new
>   networks come up)

> * have the default dnsmasq instance ignore virbr* interface via a new
>   commandline switch and have this instance use -z by default.

> However, I'd still be interested why this works for you.

I have interface=lo in my dnsmasq.conf, plus "bind-interfaces". However
you are right that stopping or restarting the main dnsmasq with the
init.d scripts kills the libvirt-bin dnsmasq, because the init.d script
kills all existing dnsmasq's (it assumes them to be children of the main
dnsmasq, and not standalone instances).

Cheers,

-- 
Adeodato Simó                                     dato at net.com.org.es
Debian Developer                                  adeodato at debian.org
 
A hacker does for love what other would not do for money.






More information about the Pkg-libvirt-maintainers mailing list