Red Hat Bugzilla – Bug 1030618
allow libvirt to run without dbus daemon
Last modified: 2013-11-14 16:27:55 EST
Description of problem:
When attempting to start libvirtd inside of a docker container, it fails with:
2013-11-14 19:36:56.827+0000: 948: info : libvirt version: 0.9.8
2013-11-14 19:36:56.827+0000: 948: error : virNetServerMDNSStart:460 : internal error Failed to create mDNS client: Daemon not running
The problem seems to be that avahi_client_new() requires a running dbus daemon, even with the AVAHI_CLIENT_NO_FAIL flag.
(Note this was in an ubuntu-based container, but I believe the same issue exists with upstream libvirt and avahi.)
Daniel Berrange says that libvirt already detects whether the dbus daemon is running, and so libvirt can use that knowledge to skip the avahi_client_new() call.
Version-Release number of selected component (if applicable):
Start libvirtd without the dbus daemon running.
Steps to Reproduce:
docker run -privileged -i -t ubuntu bash
apt-get install -y libvirt-bin
mkdir -p /dev/net
mknod /dev/net/tun c 10 200
mkdir -p /usr/libexec
ln -s /usr/lib/libvirt/libvirt_lxc /usr/libexec/libvirt_lxc
2013-11-14 19:47:46.712+0000: 911: info : libvirt version: 0.9.8
2013-11-14 19:47:46.712+0000: 911: error : virNetServerMDNSStart:460 : internal error Failed to create mDNS client: Daemon not running
libvirtd starts up successfully
This was already fixed by commit:
Author: Peter Krempa <email@example.com>
Date: Mon Aug 19 11:24:04 2013 +0200
virdbus: Add virDBusHasSystemBus()
Some systems may not use DBus in their system. Add a method to check if
the system bus is available that doesn't print error messages so that
code can later check for this condition and use an alternative approach.
In version v1.1.2-rc1~82
Please try again with the new version and reopen this bug if it doesn't work for you.
Closing as CURRENTRELEASE as rawhide certainly includes the fix.