[cups-devel] job status monitoring for AppSocket

Michael Sweet msweet at apple.com
Tue Jul 12 08:00:14 PDT 2016


> On Jul 12, 2016, at 9:50 AM, Sam Hanes <sam at maltera.com> wrote:
> Hi All,
> I have an HP LaserJet printer with an EIO JetDirect card set up in CUPS via AppSocket (socket://printer:9100). It prints fine, but CUPS marks the job completed as soon as it finishes sending the PostScript data. I want it to report the printing status page-by-page and not mark the job completed until the last page is in the output tray. Extensive Google-ing hasn't revealed a documented way of getting that in CUPS.

Well, for HP printers we rely on the half-close mechanism to wait for the job to complete.  The socket backend closes the outbound socket as soon as all data is sent, then we wait for the printer to close the other side, indicating that it has finished all pages.

PJL and other mechanisms do not scale and suffer from versioning and communication issues.  And quite frankly AppSocket (and LPD) are dead as far as future development goes.  All modern (since 2010) network printers support IPP and IPP's rich job monitoring, even for (legacy) PostScript jobs.  Prior to then you might have issues with PostScript printing over IPP...

> ...
> I'm therefore assuming that CUPS doesn't currently support job status reporting for printers using the `socket` backend unless it's supplied by the driver, and HP doesn't supply it. Am I missing something?

Aside from job completion (the half close "solution") and SNMP page/status monitoring that is supported by the socket backend, yes.

> I've started playing around with implementing a filter that adds a PJL wrapper to the job, handles USTATUS reports via `cupsBackChannelRead`, and passes them on with 'PAGE:' and 'STATUS:' messages. Is that the correct approach for adding this kind of thing?


> Right now I'm writing it as a port monitor since that sounds like the right kind of filter based on what little documentation exists, but since the built-in BCP and TBCP port monitors handle encoding and not status monitoring I'm not sure. Should this be a port monitor or a regular filter? If it should be a regular filter, how should I set that up in the PPD?

The advantage of doing it as a port monitor is that it will work with all PPDs without change, but the disadvantage is that you need to enable it for every queue that needs it.

Doing it as a filter limits you to those PPDs you have updated to use it, but has the advantage of working automatically whenever you use those PPDs.

> Is this something that should be contributed to CUPS proper?

Maybe the cups-filters project, but I can tell you we won't accept this into CUPS itself due to the support burden and the lack of need for current, vendor-supported printers.

Michael Sweet, Senior Printing System Engineer

More information about the cups mailing list