Bug 2063891

Summary: Domain socket file defined in ListenStream directive in cups.socket is not removed if the unit is stopped
Product: [Fedora] Fedora Reporter: Zdenek Dohnal <zdohnal>
Component: systemdAssignee: systemd-maint
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: fedoraproject, filbranden, flepied, lnykryn, msekleta, ryncsn, ssahani, s, systemd-maint, yuwatana, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-15 06:14:34 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:

Description Zdenek Dohnal 2022-03-14 15:14:55 UTC
Hi,

this issue was found during investigation of https://github.com/OpenPrinting/cups/issues/352 .

cups.socket unit is stopped, but the file generated by it is not removed.

56>>>systemctl status cups.socket
● cups.socket - CUPS Scheduler
     Loaded: loaded (/usr/lib/systemd/system/cups.socket; enabled; vendor preset: enabled)
     Active: active (listening) since Mon 2022-03-14 15:51:48 CET; 18min ago
      Until: Mon 2022-03-14 15:51:48 CET; 18min ago
   Triggers: ● cups.service
     Listen: /run/cups/cups.sock (Stream)
      Tasks: 0 (limit: 38171)
     Memory: 0B
        CPU: 0
     CGroup: /system.slice/cups.socket

Mar 14 15:51:48 fedora systemd[1]: Listening on cups.socket - CUPS Scheduler.

[zdohnal@fedora]-[~/repo_upstream/upstream_cups (master *=)]
57>>>sudo systemctl stop cups.socket

[zdohnal@fedora]-[~/repo_upstream/upstream_cups (master *=)]
58>>>systemctl status cups.socket
○ cups.socket - CUPS Scheduler
     Loaded: loaded (/usr/lib/systemd/system/cups.socket; enabled; vendor preset: enabled)
     Active: inactive (dead) since Mon 2022-03-14 16:10:25 CET; 7s ago
   Triggers: ● cups.service
     Listen: /run/cups/cups.sock (Stream)
        CPU: 0

Mar 14 15:51:48 fedora systemd[1]: Listening on cups.socket - CUPS Scheduler.
Mar 14 16:10:25 fedora systemd[1]: cups.socket: Deactivated successfully.
Mar 14 16:10:25 fedora systemd[1]: Closed cups.socket - CUPS Scheduler.

[zdohnal@fedora]-[~/repo_upstream/upstream_cups (master *=)]
59>>>ls -lah /run/cups/cups.sock
srw-rw-rw-. 1 root root 0 Mar 14 15:51 /run/cups/cups.sock


According to the upstream issue, it should be UNIX programming common practice to remove the cups.sock when the unit is not active.

Is it an expected behavior or a bug?

Comment 1 Zdenek Dohnal 2022-03-15 06:14:34 UTC
Sorry for the noise, 'RemoveOnStop' does the trick.