Bug 746111

Summary: libvirtd fails to start due to mDNS requirement
Product: Red Hat Enterprise Linux 6 Reporter: Brian Harrington <bharrington>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2CC: acathrow, ajia, dallan, dyuan, kburres, laine, msvoboda, mzhan, rwu, weizhan, whuang, ydu
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.9.9-0rc1.el6 Doc Type: Bug Fix
Doc Text:
The libvirt package was missing a dependency on the avahi-libs package. The dependency is required due to libvirt linking in libavahi-client for mDNS support. As a consequence, the libvirtd daemon failed to start if the libvirt package was installed on the system without the avahi-libs package. With this update, the dependency on avahi-libs is now defined in the libvirt.spec file, and avahi-libs is installed along with libvirt.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 06:35:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 770957    

Description Brian Harrington 2011-10-13 22:18:13 UTC
Description of problem:
When performing an installation of virt-manager, it requires either avahi to be installed & mDNS to be configured or to have the base configuration file modified to turn of mDNS support.

How reproducible:
100%

Steps to Reproduce:
1. Do "minimal" install of RHEL 6 (in this case, beta)
2. yum groupinstall Virtualization
3. yum install libvirt
4. run "libvirtd"
  
Actual results:
[root@server1 ~]# libvirtd
14:16:33.974: 7673: info : libvirt version: 0.9.4, package: 12.el6 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2011-09-20-06:17:46, hs20-bc2-5.build.redhat.com)
14:16:33.974: 7673: error : virNetServerMDNSStart:460 : internal error Failed to create mDNS client: Daemon not running


Expected results:
libvirtd should start and continue execution in the foreground

Additional info:
If line #60 is un-commented (turning off mDNS support), then libvirtd will execute in the foreground as expected (though with other dependency errors)

Comment 1 Brian Harrington 2011-10-13 22:20:19 UTC
Accidentally submitted the bug against virt-manager not libvirt.  Fixed categorization.

Comment 3 Dave Allan 2011-10-14 15:50:15 UTC
I have reproduced the problem; libvirtd should have a dependency on avahi.  The problem can be worked around, as you point out, by turning off mDNS in /etc/libvirt/libvirtd.conf

# Flag toggling mDNS advertizement of the libvirt service.
#                                            
# Alternatively can disable for all services on a host by
# stopping the Avahi daemon
#
# This is enabled by default, uncomment this to disable it
#mdns_adv = 0

Installing the avahi package also allows libvirtd to start.

Comment 6 Daniel Veillard 2011-12-29 14:09:06 UTC
Small patch to the spec file pushed upstream:

http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=cbc7025942fa25048001ba1459a129495113cf06

Daniel

Comment 9 yanbing du 2012-01-06 07:02:50 UTC
After install avahi, and reboot the host, libvirtd auto start. If i stop libvirtd service and run "libvirtd" in the foreground, there some iptables error output, and libvirtd will still running:

# service libvirtd stop
Stopping libvirtd daemon:                                  [  OK  ]
# libvirtd
01:57:04.078: 1845: info : libvirt version: 0.9.4, package: 23.el6_2.3 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2012-01-03-21:53:34, x86-001.build.bos.redhat.com)
01:57:04.078: 1845: error : virCommandWait:2178 : internal error Child process (/sbin/iptables --table nat --delete POSTROUTING --source 192.168.122.0/24 -p tcp ! --destination 192.168.122.0/24 --jump MASQUERADE --to-ports 1024-65535) status unexpected: exit status 1
01:57:04.079: 1845: error : virCommandWait:2178 : internal error Child process (/sbin/iptables --table nat --delete POSTROUTING --source 192.168.122.0/24 -p udp ! --destination 192.168.122.0/24 --jump MASQUERADE --to-ports 1024-65535) status unexpected: exit status 1
01:57:04.081: 1845: error : virCommandWait:2178 : internal error Child process (/sbin/iptables --table nat --delete POSTROUTING --source 192.168.122.0/24 ! --destination 192.168.122.0/24 --jump MASQUERADE) status unexpected: exit status 1
01:57:04.082: 1845: error : virCommandWait:2178 : internal error Child process (/sbin/iptables --table filter --delete FORWARD --destination 192.168.122.0/24 --out-interface virbr0 --match state --state ESTABLISHED,RELATED --jump ACCEPT) status unexpected: exit status 1
01:57:04.084: 1845: error : virCommandWait:2178 : internal error Child process (/sbin/iptables --table filter --delete FORWARD --source 192.168.122.0/24 --in-interface virbr0 --jump ACCEPT) status unexpected: exit status 1
01:57:04.085: 1845: error : virCommandWait:2178 : internal error Child process (/sbin/iptables --table filter --delete FORWARD --in-interface virbr0 --out-interface virbr0 --jump ACCEPT) status unexpected: exit status 1
01:57:04.086: 1845: error : virCommandWait:2178 : internal error Child process (/sbin/iptables --table filter --delete FORWARD --out-interface virbr0 --jump REJECT) status unexpected: exit status 1
01:57:04.087: 1845: error : virCommandWait:2178 : internal error Child process (/sbin/iptables --table filter --delete FORWARD --in-interface virbr0 --jump REJECT) status unexpected: exit status 1
01:57:04.089: 1845: error : virCommandWait:2178 : internal error Child process (/sbin/iptables --table filter --delete INPUT --in-interface virbr0 --protocol udp --destination-port 53 --jump ACCEPT) status unexpected: exit status 1
01:57:04.090: 1845: error : virCommandWait:2178 : internal error Child process (/sbin/iptables --table filter --delete INPUT --in-interface virbr0 --protocol tcp --destination-port 53 --jump ACCEPT) status unexpected: exit status 1
01:57:04.091: 1845: error : virCommandWait:2178 : internal error Child process (/sbin/iptables --table mangle --delete POSTROUTING --out-interface virbr0 --protocol udp --destination-port 68 --jump CHECKSUM --checksum-fill) status unexpected: exit status 1
01:57:04.092: 1845: error : virCommandWait:2178 : internal error Child process (/sbin/iptables --table filter --delete INPUT --in-interface virbr0 --protocol udp --destination-port 67 --jump ACCEPT) status unexpected: exit status 1
01:57:04.094: 1845: error : virCommandWait:2178 : internal error Child process (/sbin/iptables --table filter --delete INPUT --in-interface virbr0 --protocol tcp --destination-port 67 --jump ACCEPT) status unexpected: exit status 1
01:57:04.095: 1845: error : virCommandWait:2178 : internal error Child process (/sbin/iptables --table filter --insert INPUT --in-interface virbr0 --protocol tcp --destination-port 67 --jump ACCEPT) status unexpected: exit status 1
01:57:04.095: 1845: error : networkAddGeneralIptablesRules:1247 : failed to add iptables rule to allow DHCP requests from 'virbr0'
01:57:04.146: 1845: error : ebiptablesDriverInit:3667 : internal error firewall tools were not found or cannot be used
01:57:04.150: 1845: error : virCommandWait:2178 : internal error Child process (/usr/sbin/dmidecode -q -t 0,1,4,17) status unexpected: exit status 1
01:57:04.150: 1845: error : virSysinfoRead:475 : internal error Failed to execute command (null)

Comment 10 yanbing du 2012-01-13 06:51:28 UTC
On libvirt-0.9.9-1.el6.x86_64, there's no such error messages output, so move this bug to VERIFIED.

Comment 11 Miroslav Svoboda 2012-01-17 12:53:34 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
The libvirt package was missing a dependency on the avahi package. The dependency is required due to mDNS support which is turned on by default. As a consequence, the libvirtd daemon failed to start if the libvirt package was installed on the system without Avahi. With this update, the dependency on avahi is now defined in the libvirt.spec file, and Avahi is installed along with libvirt.

Comment 12 Laine Stump 2012-02-13 19:06:33 UTC
Note that the avahi-daemon service should *NOT* need to be started for libvirtd to successfully start (and in my tests it wasn't. Also, the avahi package shouldn't be needed. All that should be needed is the avahi-libs package, so that libvirtd can successfully find and runtime-link the avahi client functions it needs.

I have tested this with libvirt-0.9.9-2.el6. It started with or without avahi-daemon running (and with only avahi-libs installed).

Note also that the libvirt specfile upstream (0.9.10) has been modified to require avahi-libs rather than avahi. See Bug 785269.

I think this bug should be re-tested (with only avahi-libs installed (not avahi) once there is a 0.9,10 build for RHEL. It could be that the failure seen here had a different root cause

Comment 13 Laine Stump 2012-02-16 02:28:49 UTC
I've updated the technical notes field to reflect current reality.

Comment 14 Laine Stump 2012-02-16 02:28:49 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-The libvirt package was missing a dependency on the avahi package. The dependency is required due to mDNS support which is turned on by default. As a consequence, the libvirtd daemon failed to start if the libvirt package was installed on the system without Avahi. With this update, the dependency on avahi is now defined in the libvirt.spec file, and Avahi is installed along with libvirt.+The libvirt package was missing a dependency on the avahi-libs package. The dependency is required due to libvirt linking in libavahi-client for mDNS support. As a consequence, the libvirtd daemon failed to start if the libvirt package was installed on the system without the avahi-libs package. With this update, the dependency on avahi-libs is now defined in the libvirt.spec file, and avahi-libs is installed along with libvirt.

Comment 16 errata-xmlrpc 2012-06-20 06:35:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0748.html