Some technical background info to the new proxy mode:
- The proxy mode is invoked if there is an
/etc/cups/cupsd.conf
file present and readable (at least for root in the Snap), independent of whether there is actually a CUPS daemon running or not. This form of proxy mode invocation prevents race conditions on whether the CUPS Snap or the system’s CUPS starts first during boot. We cannot for example check for the presence of thecupsd
executable file, as the Snap can only read/etc/cups
in the system. - The mirroring of print queues from the system’s CUPS daemon to the Snap’s CUPS daemon is done by an auxiliary daemon named
cups-proxyd
. This daemon listens for appearing and disappearing of arbitrary IPP print services via DNS-SD (to get note of printers which could create temporary on-demand queues on the system’s CUPS) and for print queue addition/modification/removal and printer status change via system’s CUPS D-Bus notifications (to get note of queue modifications on the system’s CUPS even if the queues are not shared). On each event it freshly mirrors all queues from the system’s CUPS to the Snap’s CUPS and also removes disappeared queues from the Snap’s CUPS. It even mirrors temporary queues which CUPS creates on-demand for discovered IPP printers, by force-creating them on the system’s CUPS via a dummy access and then mirroring them. - There is no
apps:
entry insnapcraft.yaml
forcups-proxyd
.cups-proxyd
is completely managed by therun-cupsd
andstop-cupsd
scripts. We do not run it as drop-in replacement forcups-browsed
by therun-cups-browsed
script as we want to spin outcups-browsed
into its own Snap later. -
cups-browsed
is not run in proxy mode, therun-cups-browsed
script is simply running alone, withoutcups-browsed
, with a dummy daemon process whichstop-cups-browsed
can kill. - The configuration of the system’s CUPS does not need to be changed by the user for that, nor is it changed by the CUPS Snap (the CUPS Snap does no administrative action on the system’s CUPS at all). The printers of the system’s CUPS do not even need to get shared for the proxy to work. If unsnapped applications on the local machine can print, the proxy works.
- To allow the queues of the Snap’s CUPS pass on the jobs to the original queues on the system’s CUPS without the system’s CUPS needing to share them, a special CUPS backend named
proxy
got created, which gets the system’s CUPS’ socket and the queue name via the device URI and prints the same way aslp
would do, passing on the options of the original job. - The mirrored queues on the Snap’s CUPS do not filter the jobs any further than to PDF. The remaining filtering to the printer’s native language is done by the system’s CUPS. So the user’s drivers (especially proprietary ones) are continued to be used. The options are made available in the mirrored queus simply by copying the PPD files, but the filter rules in the PPD files are changed to stop the filtering at PDF.
-
cups-proxyd
is simple, it has no configuration file, it is controlled only by its command line. It has a log file, in the CUPS Snap it is/var/snap/cups/current/var/log/cups-proxyd_log
. - The source code of
cups-proxyd
andproxy
is maintained in the CUPS Snap project, in thecups-proxyd/
subdirectory, as these only make sense in the Snap.