Bug 631271 - avahi-daemon started when it should not be
avahi-daemon started when it should not be
Product: Fedora
Classification: Fedora
Component: avahi (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Lennart Poettering
Fedora Extras Quality Assurance
: 634532 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2010-09-07 13:46 EDT by Tom Horsley
Modified: 2011-03-08 18:19 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2011-03-08 18:19:57 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
[PATCH] DBus activate an alias which can be disabled (929 bytes, patch)
2010-09-16 07:00 EDT, Michal Schmidt
no flags Details | Diff

  None (edit)
Description Tom Horsley 2010-09-07 13:46:21 EDT
Description of problem:
See this thread in the fedora test list:


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
Actual results:
avahi-daemon running

Expected results:
No avahi-daemon

Additional info:
Comment 1 Lennart Poettering 2010-09-07 13:51:09 EDT
Avahi nowadays uses bus activation, which causes this.
Comment 2 Nicholas Miell 2010-09-07 16:56:19 EDT
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 11:43:04 EDT
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 06:34:34 EDT
*** Bug 634532 has been marked as a duplicate of this bug. ***
Comment 5 Michal Schmidt 2010-09-16 06:54:35 EDT
The bug is that /usr/share/dbus-1/system-services/org.freedesktop.Avahi.service directly references 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 07:00:11 EDT
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 07:12:53 EDT
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 15:02:49 EDT
Confirmed. With the patch apply "disable" works and avahi is no longer started during startup.
Comment 9 Lennart Poettering 2011-03-08 18:19:57 EST
A patch like this one was applied a while back. Thanks putting this together, Michal!

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