Bug 2063891 - Domain socket file defined in ListenStream directive in cups.socket is not removed if the unit is stopped
Summary: Domain socket file defined in ListenStream directive in cups.socket is not r...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-14 15:14 UTC by Zdenek Dohnal
Modified: 2022-03-15 06:14 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-15 06:14:34 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


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