Bug 1069306

Summary: socket stays active even though its service cannot start (is masked)
Product: Red Hat Enterprise Linux 7 Reporter: Karel Volný <kvolny>
Component: systemdAssignee: systemd-maint
Status: CLOSED UPSTREAM QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: jsynacek, lnykryn, mschmidt, systemd-maint-list
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1068542 Environment:
Last Closed: 2019-03-07 12:06:21 UTC Type: Bug
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: 1068542    
Bug Blocks: 1297395    

Description Karel Volný 2014-02-24 17:17:21 UTC
I was able to reproduce my problem also on RHEL7 with systemd-208-4.el7

following is the comment which explains the root cause:


+++ This bug was initially created as a clone of Bug #1068542 +++

--- Additional comment from Michal Schmidt on 2014-02-24 10:04:28 EST ---

systemd-journald is a bit special in the way its socket survives the switch-root from the initramfs. Nevertheless, here's a reproducer that involves neigher initramfs nor systemd-journald:

1. Make sure a socket and its service are both "active (running)":
     systemctl start avahi-daemon.{socket,service}
2. Mask only the service:
     systemctl mask avahi-daemon.service
3. Stop the service:
     systemctl stop avahi-daemon.service
4. Check the resulting statuses:
     systemctl status avahi-daemon.{socket,service}

Actual result: Though the service is now inactive, the socket unit is still "active (running)". This is an inconsistency.
Expected result: The socket should be at most "active (listening)", so it can go into "failed" by itself when a connection is attempted.

I think the socket failed to notice the death of the service because socket_trigger_notify() returns early if the service's load state is UNIT_MASKED (!= UNIT_LOADED).

Comment 2 RHEL Program Management 2014-03-22 05:57:39 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 5 Jan Synacek 2019-03-07 12:06:21 UTC
As nobody seems to care enough (or at all, to be precise), let's close this here and leave the report upstream only.

Comment 6 Jan Synacek 2019-03-07 12:06:38 UTC
https://github.com/systemd/systemd/issues/4708