CHROMIUM: Limit job monitoring bypass to print servers

In e94205f4f2ab717df6670fc5afabe8017c02a46c ("backend/ipp: Finish job
after successful submission"), the IPP backend was changed to stop
monitoring submitted jobs as soon as the printer sets
printer-is-accepting-jobs to true.  This allows multiple jobs to be
submitted to a remote print server without waiting for them all to
finish printing.

However, this also breaks job status monitoring and reporting for some
directly connected printers.  These printers will set
printer-is-accepting-jobs when a tray is out of paper (and maybe other
error conditions).  Presumably the manufacturer's assumption is that the
user can still submit jobs that use a different paper tray.  Regardless,
the net effect is that ChromeOS immediately reports that a job is
printed when it is actually stopped with an "Out of paper" error
message.

Since the original change was made to support the print server case,
restrict the monitoring behavior change to print server printers.  These
are detected by looking for /printers/ in the URI because the Chrome
side always hardcodes this path when setting up a print server printer.

BUG=b:265460251
TEST=Print with insufficient paper and verify Print Management UI

Change-Id: If929954d4f4479cb9037cfaf7f1be663ce0edd57
Disallow-Recycled-Builds: test-failures
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/cups/+/4626345
Commit-Queue: Benjamin Gordon <bmgordon@chromium.org>
Reviewed-by: Nathan Muggli <nmuggli@google.com>
Tested-by: Benjamin Gordon <bmgordon@chromium.org>
1 file changed
tree: d3597830c2a1b2cb887cfeec04a29efc1baf7b48
  1. .github/
  2. backend/
  3. berkeley/
  4. cgi-bin/
  5. chromeos/
  6. conf/
  7. config-scripts/
  8. cups/
  9. data/
  10. desktop/
  11. doc/
  12. examples/
  13. filter/
  14. fuzzers/
  15. locale/
  16. man/
  17. monitor/
  18. notifier/
  19. packaging/
  20. ppdc/
  21. scheduler/
  22. scripts/
  23. systemv/
  24. templates/
  25. test/
  26. tools/
  27. vcnet/
  28. xcode/
  29. .clang-format
  30. .codacy.yml
  31. .gitattributes
  32. .gitignore
  33. .lgtm.yml
  34. .mailmap
  35. .presubmitignore
  36. .travis.yml
  37. CHANGES-OPENPRINTING.md
  38. CHANGES.md
  39. config.guess
  40. config.h.in
  41. config.sub
  42. configure.ac
  43. CONTRIBUTING.md
  44. CREDITS.md
  45. cups-config.in
  46. cups.pc.in
  47. DEVELOPING.md
  48. DIR_METADATA
  49. install-sh
  50. INSTALL.md
  51. LICENSE
  52. Makedefs.in
  53. Makefile
  54. NOTICE
  55. option_mapping.md
  56. OWNERS
  57. PRESUBMIT.cfg
  58. README.md
README.md

OpenPrinting CUPS v2.4.0

Version Apache 2.0 Build and Test

Introduction

OpenPrinting CUPS is a standards-based, open source printing system for Linux® and other Unix®-like operating systems. CUPS supports printing to:

  • AirPrint™ and IPP Everywhere™ printers,
  • Network and local (USB) printers with Printer Applications, and
  • Network and local (USB) printers with (legacy) PPD-based printer drivers.

CUPS provides the System V (“lp”) and Berkeley (“lpr”) command-line interfaces, a configurable web interface, a C API, and common print filters, drivers, and backends for printing. The cups-filters project provides additional filters and drivers.

CUPS is licensed under the Apache License Version 2.0 with an exception to allow linking against GNU GPL2-only software. See the files LICENSE and NOTICE for more information.

Reading the Documentation

Initial documentation to get you started is provided in the root directory of the CUPS sources:

  • CHANGES.md: A list of changes in the current major release of CUPS.
  • CONTRIBUTING.md: Guidelines for contributing to the CUPS project.
  • CREDITS.md: A list of past contributors to the CUPS project.
  • DEVELOPING.md: Guidelines for developing code for the CUPS project.
  • INSTALL.md: Instructions for building and installing CUPS.
  • LICENSE: The CUPS license agreement (Apache 2.0).
  • NOTICE: Copyright notices and exceptions to the CUPS license agreement.
  • README.md: This file.

Once you have installed the software you can access the documentation (and a bunch of other stuff) online at http://localhost:631/ and using the man command, for example man cups.

If you're having trouble getting that far, the documentation is located under the doc/help and man directories.

Please read the documentation before asking questions.

Getting Support and Other Resources

In addition to the OpenPrinting CUPS home page at https://openprinting.github.io/cups, we provide a mailing list for CUPS users and developers to ask questions and discuss issues at https://linuxfoundation.groups.io/g/printing.

Setting Up Printers

CUPS includes a web-based administration tool that allows you to manage printers, classes, and jobs on your server. Open http://localhost:631/admin/ in your browser to access the printer administration tools. You will be asked for the administration password (root or any other user in the “sys”, “system”, “root”, “admin”, or “lpadmin” group on your system) when performing any administrative function.

The lpadmin command is used to manage printers from the command-line. For example, the following command creates a print queue called “myprinter” for an IPP Everywhere printer at address “11.22.33.44”:

lpadmin -p myprinter -E -v "ipp://11.22.33.44/ipp/print" -m everywhere

The -p option specifies the printer name. The -E option enables the printer and accepts new print jobs immediately. The -v option specifies the device URI for the printer, which tells CUPS how to communicate with the printer. And the -m option specifies the model (driver) to use, in this case the IPP Everywhere (“everywhere”) driver that is used for AirPrint and IPP Everywhere printers as well as shared printers and printers supported through Printer Applications.

Legacy printers are supported using PPD (PostScript Printer Description) files that describe printer capabilities and driver programs needed for each printer. CUPS includes several sample PPD files for common legacy printers:

DriverPPD Name
Dymo Label Printersdrv:///sample.drv/dymo.ppd
Intellitech Intellibardrv:///sample.drv/intelbar.ppd
EPSON 9-pin Seriesdrv:///sample.drv/epson9.ppd
EPSON 24-pin Seriesdrv:///sample.drv/epson24.ppd
Generic PCL Laser Printerdrv:///sample.drv/generpcl.ppd
Generic PostScript Printerdrv:///sample.drv/generic.ppd
HP DeskJet Seriesdrv:///sample.drv/deskjet.ppd
HP LaserJet Seriesdrv:///sample.drv/laserjet.ppd
OKIDATA 9-Pin Seriesdrv:///sample.drv/okidata9.ppd
OKIDATA 24-Pin Seriesdrv:///sample.drv/okidat24.ppd
Zebra CPCL Label Printerdrv:///sample.drv/zebracpl.ppd
Zebra EPL1 Label Printerdrv:///sample.drv/zebraep1.ppd
Zebra EPL2 Label Printerdrv:///sample.drv/zebraep2.ppd
Zebra ZPL Label Printerdrv:///sample.drv/zebra.ppd

The sample drivers provide basic printing capabilities, but generally do not exercise the full potential of the printers or CUPS. Other drivers provide greater printing capabilities.

You can run the lpinfo -m command to list all of the available drivers:

lpinfo -m

Similarly, the lpinfo -v command lists the available printers and their device URIs:

lpinfo -v

Once you know the device URI and driver name, add the printer using the lpadmin command:

lpadmin -p PRINTER-NAME -E -v "DEVICE-URI" -m DRIVER-NAME

Printing Files

CUPS provides both the System V lp and Berkeley lpr commands for printing:

lp FILENAME
lpr FILENAME

Both the lp and lpr commands support printing options:

lp -o media=A4 -o resolution=600dpi FILENAME
lpr -o media=A4 -o resolution=600dpi FILENAME

CUPS recognizes many types of images files as well as PDF, PostScript, and text files, so you can print those files directly rather than through an application.

If you have an application that generates output specifically for your printer then you need to use the -oraw or -l options:

lp -o raw FILENAME
lpr -l FILENAME

This will prevent the filters from misinterpreting your print file.

Legal Stuff

Copyright © 2020-2021 by OpenPrinting

Copyright © 2007-2020 by Apple Inc.

Copyright © 1997-2007 by Easy Software Products.

CUPS is provided under the terms of the Apache License, Version 2.0 with exceptions for GPL2/LGPL2 software. A copy of this license can be found in the file LICENSE. Additional legal information is provided in the file NOTICE.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.