You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[2.4.9 regression] cupsd don't start when only Listen /path/to/domain/socket is set in conf #985
Describe the bug
Setting cupsd to listen only on socket path prevents cups daemon from starting. It worked in 2.4.8 and before and stopped working in 2.4.9.
If the only Listen directive in cupsd.conf is set to socket path like: Listen /run/cups/cups.sock
then cupsd daemon fails to start when running from systemd: cups.service: Failed with result 'protocol'.
The cups error log shows: No valid Listen or Port lines were found in the configuration file.
To Reproduce
Steps to reproduce the behavior (on ArchLinux):
Go to /etc/cups/cupsd.conf and remove any other Listen directive than Listen /run/cups/cups.sock
Run systemct start cups.socket
Run systemctl start cups
See cups.service: Failed with result 'protocol'. and No valid Listen or Port lines were found in the configuration file. error messages
Expected behavior
I expect cupsd service to start like before
System Information:
OS: ArchLinux
Cups 2.4.9
Additional context
By reading changelog I presume it's somewhat related to a436956 but the listening on socket functionality is still present in cups and I don't know what users are supposed to do to make it work.
If I remove Listen /run/cups/cups.sock from config then it fails with the same error message: No valid Listen or Port lines were found in the configuration file. so something isn't working as it should. Does anyone has it working with only Listen on socket file?
The @CUPS_LISTEN_DOMAINSOCKET@ is also provided by default in cupsd.conf so the only thing I did is to remove Listen localhost:@DEFAULT_IPP_PORT@ line above because I don't want it to listen on local network. I don't see what I did wrong @zdohnal do you have any idea how it should work after your changes?
Ok, we did not count the possibility the Listen for socket is the only Listen directive in the cupsd.conf. In that case, the Listen line for .sock is ignored, thus the service is not started.
@michaelrsweet probably we have to move continue into the if block, so we don't omit the socket if it matches the expected domain socket name. WDYT?
Ok, we did not count the possibility the Listen for socket is the only Listen directive in the cupsd.conf. In that case, the Listen line for .sock is ignored, thus the service is not started.
Even if there are two Listen directives and the service start does cups listen on both or is socket no-op?
@michaelrsweet A added 6131f6a on top of 2.4.9 but unfortunately it still fails with the same error: No valid Listen or Port lines were found in the configuration file.
Activity
michaelrsweet commentedon Jun 13, 2024
Sounds like a configuration problem - systemd is supposed to supply the domain socket to cupsd when running on-demand.
Maryse47 commentedon Jun 13, 2024
I use the default cups.service and cups.socket provided from this repo.
Maryse47 commentedon Jun 13, 2024
If I remove
Listen /run/cups/cups.sockfrom config then it fails with the same error message:No valid Listen or Port lines were found in the configuration file.so something isn't working as it should. Does anyone has it working with onlyListenon socket file?Maryse47 commentedon Jun 13, 2024
The
@CUPS_LISTEN_DOMAINSOCKET@is also provided by default in cupsd.conf so the only thing I did is to removeListen localhost:@DEFAULT_IPP_PORT@line above because I don't want it to listen on local network. I don't see what I did wrong @zdohnal do you have any idea how it should work after your changes?zdohnal commentedon Jun 14, 2024
Ok, we did not count the possibility the Listen for socket is the only Listen directive in the cupsd.conf. In that case, the Listen line for .sock is ignored, thus the service is not started.
@michaelrsweet probably we have to move
continueinto the if block, so we don't omit the socket if it matches the expected domain socket name. WDYT?zdohnal commentedon Jun 14, 2024
Or do not let the loading fail - I'll look into the code.
Maryse47 commentedon Jun 14, 2024
Even if there are two Listen directives and the service start does cups listen on both or is socket no-op?
Don't abort early if there are no listen sockets after loading cupsd.…
Don't abort early if there are no listen sockets after loading cupsd.…
michaelrsweet commentedon Jun 14, 2024
@zdohnal @Maryse47 OK, I think I have a fix:
[master 7adb508] Don't abort early if there are no listen sockets after loading cupsd.conf (Issue #985)
[2.4.x 6131f6a] Don't abort early if there are no listen sockets after loading cupsd.conf (Issue #985)
Maryse47 commentedon Jun 14, 2024
@michaelrsweet A added 6131f6a on top of 2.4.9 but unfortunately it still fails with the same error:
No valid Listen or Port lines were found in the configuration file.6 remaining items
scheduler: Fix cupsd activated on-demand via socket (fixes OpenPrinti…
scheduler: Fix cupsd activated on-demand via socket
Maryse47 commentedon Jun 17, 2024
Here's excerpt from log using 2.4.x git branch:
scheduler: Fix cupsd activated on-demand via socket
scheduler: Fix cupsd activated on-demand via socket
scheduler: Fix cupsd activated on-demand via socket
scheduler: Fix cupsd activated on-demand via socket
cups: fix socket-only usage
nixos/tests/printing: test cases for domain socket only config
nixos/tests/printing: test cases for domain socket only config