Bug 1030618 - allow libvirt to run without dbus daemon
Summary: allow libvirt to run without dbus daemon
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-14 19:49 UTC by Josh Poimboeuf
Modified: 2013-11-14 21:27 UTC (History)
10 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-11-14 21:27:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Josh Poimboeuf 2013-11-14 19:49:10 UTC
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
libvirtd

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 21:27:55 UTC
This was already fixed by commit:

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