Bug 1079854 - systemd starts avahi although it has been disabled
systemd starts avahi although it has been disabled
Status: NEW
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Printing
Current
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: openSUSE GNOME
Johannes Meixner
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-02-07 14:43 UTC by Peter Sütterlin
Modified: 2018-02-12 07:56 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Sütterlin 2018-02-07 14:43:03 UTC
I had installed avahi for some tests on my TW laptop (20180203), but don't need it normally.  So I disabled it using
  systemctl disable avahi-daemon
  systemctl disable avahi-daemon.socket

I was quite surprised that after the next boot it was running again!

woodstock: # systemctl status avahi-daemon.service
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
   Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; disabled; vendor preset: enabled)
   Active: active (running) since Tue 2018-02-06 12:44:52 CET; 22h ago

woodstock: # systemctl status avahi-daemon.socket
● avahi-daemon.socket - Avahi mDNS/DNS-SD Stack Activation Socket
   Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.socket; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-02-06 12:44:52 CET; 22h ago

and indeed from 'journalctl -b| grep -v avahi' I get
Feb 06 12:44:52 woodstock systemd[1]: Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
Feb 06 12:44:52 woodstock systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Feb 06 12:44:52 woodstock avahi-daemon[1062]: Found user 'avahi' (UID 486) and group 'avahi' (GID 485).
Feb 06 12:44:52 woodstock avahi-daemon[1062]: Successfully dropped root privileges.
Feb 06 12:44:52 woodstock avahi-daemon[1062]: avahi-daemon 0.6.32 starting up.
Feb 06 12:44:52 woodstock systemd[1]: Started Avahi mDNS/DNS-SD Stack.

Why is systemd starting an explicitely disabled service?
Comment 1 Peter Sütterlin 2018-02-08 11:31:49 UTC
OK, this is probably a works-as-intended, although I don't think it should be like this.

The start is caused by cups-browsed.service, which has a line
Wants=avahi-daemon.servicesystemd.service

This overrides the explicit disable of the service.  But no error is created when avahi is not installed, which means it will use it if it's there, else not(?), so the After=avahi-daemon.service should be enough for that.

IMHO the Wants= entry should go away....
Comment 2 Dominique Leuenberger 2018-02-12 07:56:07 UTC
(In reply to Peter Sütterlin from comment #1)
> OK, this is probably a works-as-intended, although I don't think it should
> be like this.
> 
> The start is caused by cups-browsed.service, which has a line
> Wants=avahi-daemon.servicesystemd.service
> 
> This overrides the explicit disable of the service.  But no error is created
> when avahi is not installed, which means it will use it if it's there, else
> not(?), so the After=avahi-daemon.service should be enough for that.

As this assessment is correct, I'm passing it on to the printing component, which is responsible for 'cups-browsed.service'
 
> IMHO the Wants= entry should go away....