Bug 631271

Summary: avahi-daemon started when it should not be
Product: [Fedora] Fedora Reporter: Tom Horsley <horsley1953>
Component: avahiAssignee: Lennart Poettering <lpoetter>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: chemobejk, jclift, lpoetter, mattdm, metherid, mschmidt, nmiell, notting, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-08 23:19:57 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:
Attachments:
Description Flags
[PATCH] DBus activate an alias which can be disabled none

Description Tom Horsley 2010-09-07 17:46:21 UTC
Description of problem:
See this thread in the fedora test list:

http://lists.fedoraproject.org/pipermail/test/2010-September/093396.html

Apparently creating a client callback for avahi causes the avahi-daemon to
be started under systemd, this was not the case previously.

I have confirmed that my fedora 13 libvirtd.conf file does not modify
the mdns_adv setting, but I don't get avahi-daemon running on f13.

On f14 (with systemd) I need to uncomment the mdns_adv=0 line to prevent
avahi-daemon from starting (event though it is disabled in chkconfig, it
starts anyway and the start time and pid seems to indicate it starts
immediately after libvirtd).

Version-Release number of selected component (if applicable):
systemd 9-3

How reproducible:
every time

Steps to Reproduce:
1.see above
2.
3.
  
Actual results:
avahi-daemon running

Expected results:
No avahi-daemon

Additional info:

Comment 1 Lennart Poettering 2010-09-07 17:51:09 UTC
Avahi nowadays uses bus activation, which causes this.

Comment 2 Nicholas Miell 2010-09-07 20:56:19 UTC
Previously, libvirtd had a soft dependency on avahi (by passing AVAHI_CLIENT_NO_FAIL to avahi_client_new), and it would operate with or without a running avahi daemon.

The change to bus activation results in a hard dependency on avahi, which represents a regression over the previous feature set.

Comment 3 Stefan Becker 2010-09-11 15:43:04 UTC
It's not only libvirtd that triggers avahi daemon startup. I don't have libvirtd installed on this laptop but it still activated, probably by the KDE session.

But no matter what, there is still a regression: with systemd it is no longer possible to permanently disable avahi-daemon. If I understand the man page correctly then the following should work:

# systemctl disable --global avahi-daemon.service avahi-daemon.socket
Couldn't find avahi-daemon.service.

Comment 4 Michal Schmidt 2010-09-16 10:34:34 UTC
*** Bug 634532 has been marked as a duplicate of this bug. ***

Comment 5 Michal Schmidt 2010-09-16 10:54:35 UTC
The bug is that /usr/share/dbus-1/system-services/org.freedesktop.Avahi.service directly references avahi-daemon.service:
  SystemdService=avahi-daemon.service

Instead avahi-daemon.service should define an installable Alias and the D-Bus service file should reference that.

Comment 6 Michal Schmidt 2010-09-16 11:00:11 UTC
Created attachment 447717 [details]
[PATCH] DBus activate an alias which can be disabled

This should fix it, but I haven't tested it yet.

Comment 7 Michal Schmidt 2010-09-16 11:12:53 UTC
Tested it now and it works as expected.
systemctl {en,dis}able avahi-daemon.service now have the desired effect.

Comment 8 Stefan Becker 2010-09-16 19:02:49 UTC
Confirmed. With the patch apply "disable" works and avahi is no longer started during startup.

Comment 9 Lennart Poettering 2011-03-08 23:19:57 UTC
A patch like this one was applied a while back. Thanks putting this together, Michal!