[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

systemd socket activation of cupsd also via port 631 and not only via domain socket?



Hi,

recently some Ubuntu users complained about CUPS stopping after an idle timeout and then not restarting in certain situations, like when accessing CUPS' web interface. See

https://bugs.launchpad.net/ubuntu/+source/cups/+bug/1598300

https://bugs.launchpad.net/ubuntu/+source/cups/+bug/1622707

https://github.com/apple/cups/issues/4874

The problem is that the systemd unit file for socket activation which comes with CUPS only supports triggering CUPS when it is accessed throu the domain socket file. It looks like this:

----------
[Unit]
Description=CUPS Scheduler

[Socket]
ListenStream=/var/run/cups/cups.sock

[Install]
WantedBy=sockets.target
----------

This works well enough for applications using libcups, as these applications access via the domain socket if CUPS is configured appropriately.

The web interface is called through a web browser and in a web browser you can only specify a host and a port, so the access to CUPS is through port 631. To make CUPS being fired up also in this case, a line "ListenStream=631" needs to get added:

----------
[Unit]
Description=CUPS Scheduler

[Socket]
ListenStream=/var/run/cups/cups.sock
ListenStream=631

[Install]
WantedBy=sockets.target
----------

Then I can access CUPS after it has shut down after the idle timeout, with both libcups-based applications (simplest example: "lpstat -r") and with the web interface.

WDYT? Should we add the "ListenStream=631" or should we create an additional unit file, like

----------
[Unit]
Description=CUPS Scheduler

[Socket]
ListenStream=631

[Install]
WantedBy=sockets.target
----------

and install it in addition to the original one, for example with the "cups" binary package which contains the CGI binaries of the web interface?

   Till


Reply to: