Bug 1030618 - allow libvirt to run without dbus daemon
allow libvirt to run without dbus daemon
Product: Fedora
Classification: Fedora
Component: libvirt (Show other bugs)
All Linux
unspecified Severity medium
: ---
: ---
Assigned To: Libvirt Maintainers
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-11-14 14:49 EST by Josh Poimboeuf
Modified: 2013-11-14 16:27 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-11-14 16:27:55 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Josh Poimboeuf 2013-11-14 14:49:10 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):

libavahi-client3 0.6.30-5ubuntu2
libvirt-bin 0.9.8-2ubuntu17

How reproducible:

Start libvirtd without the dbus daemon running.

Steps to Reproduce:

docker run -privileged -i -t ubuntu bash
apt-get update
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

Actual results:

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

Expected results:

libvirtd starts up successfully

Additional info:
Comment 1 Peter Krempa 2013-11-14 16:27:55 EST
This was already fixed by commit:

commit 2398dd3d3ea2e060318abd3d9346ad65df910803
Author: Peter Krempa <pkrempa@redhat.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.

Note You need to log in before you can comment on or make changes to this bug.