FS#32923 - [cups] Missing socket activation information for web interface
Attached to Project:
Arch Linux
Opened by Jan (medhefgo) - Saturday, 01 December 2012, 15:56 GMT
Last edited by Andreas Radke (AndyRTR) - Friday, 07 March 2014, 20:19 GMT
Opened by Jan (medhefgo) - Saturday, 01 December 2012, 15:56 GMT
Last edited by Andreas Radke (AndyRTR) - Friday, 07 March 2014, 20:19 GMT
|
Details
cups.socket is missing "ListenStream=631" for the socket
activation of the web interface. After adding it (in
addition to the other ListenStream directive) accessing the
web interafce automatically starts cups.service as it
should.
|
This task depends upon
Closed by Andreas Radke (AndyRTR)
Friday, 07 March 2014, 20:19 GMT
Reason for closing: Fixed
Additional comments about closing: should work now as expected. file new bugs if something is still wrong.
Friday, 07 March 2014, 20:19 GMT
Reason for closing: Fixed
Additional comments about closing: should work now as expected. file new bugs if something is still wrong.
Listen localhost:631
This is what is in the cups-systemd-socket.patch. We use it the same way Fedora does.
http://pkgs.fedoraproject.org/cgit/cups.git/tree/cups-systemd-socket.patch
Suggestions welcome.
If a user changes the default port then the user is responsible for updating the socket file.
For Fedora things might automagically work if they ship something that tries to get the printers list when a DE starts, hence starting cupsd (just a guess). Or users might not have noticed that going to localhost:631 doesn't work if they use some other way to configure the printers.
(1) Connecting a physical printer triggers printer.target which starts cupsd and all is well.
+ListenStream=@CUPS_DEFAULT_DOMAINSOCKET@
+ListenStream=@DEFAULT_IPP_PORT@
This way if the default port is overridden with --with-ipp-port it will also get changed in the socket file.
I have noticed that if there are any (leftover?) spool files cupsd will also get started, this might hide the corner case not yet covered by the socket file.
Going to close this as "Won't implement" - But feel free to bring up generic systemd support to include in upstream project on the cups mailing list that I'm subscribed to.
Please tell me if you're happy with 1.7.1-2.
I plan to also post on this bug report again, but I'm also debating starting a new one as the description in that one confuses the issue with something related to fstab.
- https://bugs.archlinux.org/task/38684
Thanks for any input.
John
I've tried leaving only the socket enabled or everything (socket, path and service) and after rebooting cups was always working fine.
I might start by removing cups and any configuration files (after making backups), then remove any leftover spool files in /var/spool/cups, then reinstall cups and configure a printer. Using a new user account for setting up the new printer and testing might also be a good idea since it takes browser configuration cruft from the equation.
For checking what's listening where I would use 'ss' (owned by iproute2), it is better at listing what's listening on a socket (try 'ss -napt' as root). If things are still not working I suppose trying to look at cups' logs (and making them more verbose if possible) is an option that might provide clues as to why things are not working.
As a last resort I would fire up wireshark and would try to see what differs between an install that works and one that doesn't, it might provide clues about misconfiguration somewhere else.
I suppose the result is the same as not adding your hostname in /etc/hosts (1), some stuff will work fine and some other stuff will break in strange ways.
(1) As of now this is not exactly true, if you have "myhostname" in the hosts line of /etc/nsswitch.conf you don't need to add your hostname to /etc/hosts.
I'll continue trying out this setup (I want to copy back my cups configs, re-install my work printers, and test), and can confirm after a few days that I'm still not having any issues. I'll notify some individuals having trouble on the Arch forums as well. If some can confirm, I think this can be re-closed, as it was a setup issue. Many thanks for the help!
See http://pkgs.fedoraproject.org/cgit/cups.git/tree/cups-systemd-socket.patch?id=7cb9904f3bd15b82c2aed04b8218197f822ed579
See also http://fedoraproject.org/wiki/Packaging:Systemd#Socket_activation
http://0pointer.de/blog/projects/socket-activation.html
http://0pointer.de/blog/projects/socket-activation2.html
Debian is just jumping into this socket activation here that should probably give the wanted behavior you've also requested to implement in Arch:
https://lists.debian.org/debian-printing/2014/02/msg00065.html
They add this to the socket file:
+[Socket]
+ListenStream=@CUPS_DEFAULT_DOMAINSOCKET@
+ListenStream=631
+ListenDatagram=0.0.0.0:631
+BindIPv6Only=ipv6-only
I guess the change in cups 1.7.1-2 only adding ListenStream=631 wasn't enough.
To me, the patch from debian does not seem to add anything that would be required to make things work, they use the same "ListenStream=@CUPS_DEFAULT_DOMAINSOCKET@" as we do. They hardcode the cups port, which we don't, they listen on UDP, which cups doesn't seem to listen on after starting, and as far as I can understand, in a dual stack machine they listen only on ipv6, thus breaking things if some ipv4 only machine tries to reach cups (if I'm reading the documentation correctly). This last issue might be a problem only for people sharing printers over the network.
Regarding fedora, like I said above, they might not have encountered the corner case we did yet, their patch seems to be initial enablement of systemd in general and might lack some further tuning. From their wiki page, I get the sense that either that wiki page is not very up-to-date or that they haven't given socket activation a good go yet.
On the other hand, if socket files can also be extended using /etc/systemd/system/unit.d/ (I think this was not possible when this bug was submitted), you could use what upstream provides and let users add whatever else might be needed. After more distros have given socket activation a go, I guess this can be revised and more things added to the socket file if needed, this might not be the best solution but it sticks with arch's philosophy of staying close to upstream.