3

We have a CUPS server running on Ubuntu 14.04 which has about 10 HP printers configured. We have a mix of Windows, Linux and Mac clients printing to the server flawlessly.

Flawlessly, until some of the Macs were upgraded to Sierra recently. Now, if a user tries to print via the server, the client behaves normally, as does cups. The job is processed through the server and the job log shows the job printed ok. However, nothing emerges out of the printer. The Mac clients can print directly to the printer using AirPrint.

We had an older version of cups so we built a new 16.04 server with the latest cups, same result. We can print directly to the printer from the print server on port 9100 so that part is working ok.

Is it safe to assume the problem does not lie with cups, rather with MacOS 12.12? Anyone have any troubleshooting ideas?

1

MacOS machines use their own cups server. For modern HP laser printers cups generates PostScript output but with some special settings for the target printer. The cups server on the linux machine parses the PostScript input and use his own settings to regenerate the output. On linux the filter script /usr/lib/cups/filter/hpps is called to generate the output for most HP laser printers. The problem is the PostScript output from the MacOS which seems to be ignored from cups under linux. The hpps filter script is called with an empty file and generates an empty page. The printer ignores this. We found two workarounds for the problem:

1) Send the output from MacOS compressed as gzip to the linux server. The cups server decompress the output and pipe it to the hpps filter. The filter send the source file with his own header and footer to the printer. Without special settings (e.g. banner) the output from the filter is identical to the MacOS output. To achieve this add

    ?compression=gzip

to the cups URI in your MacOS cups server. Call https://localhost:631 your browser (enable the interface in terminal with 'cupsctl WebInterface=yes'). Choose 'Modify Printer', authenticate and select the IPP or IPPS printing protocol. The target URI contains the previous URI. Append the line above, e.g.

    ipps://<ubuntu-cups-server>/printers/<printername>?compression=gzip

Keep the description and model settings and save.

2) Install a RAW printer on the linux server with the same target URI as the HP printer. But choose Raw as Maker and Model for the printer. E.g. if your printer is named 'hp1' add 'hp1_raw' as second printer. In MacOS use the RAW printer URI as destination, e.g.

    ipps://<ubuntu-cups-server>/printers/hp1_raw

A small risk remains. If someone sends on linux a non PostScript file to the raw queue the printer will print this file as text. You may get many lubricating paper pieces by printing a small PDF file.

1

The hpps filter from the hplip package is broken. Apply the patch:

--- /usr/lib/cups/filter/hpps.shipped       2017-01-13 17:23:49.000000000 +0100
+++ /usr/lib/cups/filter/hpps       2017-03-23 14:51:09.904355996 +0100
@@ -144,6 +144,9 @@

 try:
     job_id, username, title, copies, options = args[0:5]
+    if len(args) > 5:
+        input_fd = os.open(args[5], os.O_RDONLY)
+
     job_id = int(job_id)
 except IndexError:
     bug("Invalid command line: invalid arguments.")
@@ -376,7 +379,7 @@

 while True:
     try:
-        data = os.read(0, 4096)
+        data = os.read(input_fd, 4096)
     except IOError:
         bug('Unable to read from standart input')
         sys.exit(CUPS_FILTER_FAILED)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.