Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#44721 - [systemd] does not honor masked service / socket

Attached to Project: Arch Linux
Opened by Tarqi Kazan (Tarqi) - Friday, 24 April 2015, 20:02 GMT
Last edited by Dave Reisner (falconindy) - Saturday, 25 April 2015, 16:04 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To No-one
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

short:
systemd will not honor a masked service / socket in /etc/systemd/system

long:
systemd (dbus?) will always (re)start the avahi-daemon (pulled by samba/libcups), even if the service and socket are disabled. systemctl status avahi-daemon.service will show:
Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; masked; vendor preset: disabled)
This contains the wrong path (should be /etc/...), but it is recognized as masked (which is in /etc/...). After a systemctl daemon-reload, systemctl status avahi-daemon.service shows:
Loaded: masked (/dev/null)
which is correct. However, trying to stop the service will fail, because systemd will fall back to /usr/... an therefor restarts the service immediately.
In both cases, systemctl status avahi-daemon.socket shows:
Loaded: masked (/dev/null)
This showed up on a system after a reboot (after updating to 219-6). Another system without a reboot and just a systemctl daemon-reexec (which pacman does automagic :) is not showing this behaviour.

Additional info:
* system 219-6
* linux 3.19.3-3 x86_64

Steps to reproduce:
* Please see the long description above.
This task depends upon

Closed by  Dave Reisner (falconindy)
Saturday, 25 April 2015, 16:04 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Working as intended.
Comment by Dave Reisner (falconindy) - Friday, 24 April 2015, 20:24 GMT
Can you replicate this behavior with a service which isn't dbus-activated?
Comment by Tarqi Kazan (Tarqi) - Friday, 24 April 2015, 21:39 GMT
As far I can say this: No. Masking a service shows up as intended, I tested this with httpd.service (without a .socket file). It looks like dbus will interfere here. But... I am not really sure how to test this scenario correctly. If you can tell me what to do, I will help as much as I can.
Comment by Tarqi Kazan (Tarqi) - Friday, 24 April 2015, 21:45 GMT
As a test I restarted samba on the mentioned server which wasn't rebooted and... it shows exactly the same behavior. Once the dbus-service is requested, it is impossible to stop or "blacklist" it. (Edit: typos)
Comment by Dave Reisner (falconindy) - Saturday, 25 April 2015, 14:13 GMT
Well, the problem isn't really with systemd, but that there's no way to disable *dbus* activation of the avahi service (short of deleting the dbus service in /usr/share/dbus-1/...).
Comment by P.H. (Vain) - Saturday, 25 April 2015, 15:22 GMT
Hmmm... Maybe I'm missing something. I've masked them all:

$ systemctl status avahi-daemon.service avahi-daemon.socket avahi-dnsconfd.service dbus-org.freedesktop.Avahi.service
● avahi-daemon.service
Loaded: masked (/dev/null)
Active: inactive (dead)

● avahi-daemon.socket
Loaded: masked (/dev/null)
Active: inactive (dead)

● avahi-dnsconfd.service
Loaded: masked (/dev/null)
Active: inactive (dead)

● dbus-org.freedesktop.Avahi.service
Loaded: masked (/dev/null)
Active: inactive (dead)

I have to add, though, that I've masked that last one -- dbus-org.freedesktop.Avahi.service -- just recently (four days ago). Some months ago, it was sufficient to mask the first three ones (see https://bbs.archlinux.org/viewtopic.php?id=189887). According to mtime, this file is rather new anyway:

$ stat --printf='%y' /usr/lib/systemd/system/dbus-org.freedesktop.Avahi.service
2015-03-26 01:01:23.000000000 +0100

My log then says:

Apr 25 10:54:06 hostname dbus[301]: [system] Activating via systemd: service name='org.freedesktop.Avahi' unit='dbus-org.freedesktop.Avahi.service'
Apr 25 10:54:06 hostname dbus[301]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.Avahi.service': Unit dbus-org.freedesktop.Avahi.service is masked.

And no avahi is running. That's what I want. :-)

Am I just being lucky (I'm using a minimal desktop, no GNOME or similar)? Or is it indeed possible to mask dbus activation?
Comment by Dave Reisner (falconindy) - Saturday, 25 April 2015, 16:04 GMT
No, as I already said, you cannot mask dbus activation short of deleting the dbus service description. I'm closing this as not-a-bug, because there's really nothing here to fix in any package. If you want the behavior of systemd to change, then please work with upstream, but I suspect there's already a bug open along these same lines....

Loading...