GNOME Bugzilla – Bug 370685
Custom CUPS queues don't work
Last modified: 2007-06-23 13:44:52 UTC
Due to some quirks in the printer setup where I work, I created a custom CUPS printer queue that logs into another machine with ssh and spools the print job from there. Unfortunately I recently noticed that I can't print to this queue from evince anymore - when I select that queue, the "Print" button is greyed out. Printing from most other applications works fine. I assume this is because evince uses the new gtk printing code and most other apps use the old gnomeprint. Printing from the command line with lp also works. What I've done is to create a file /etc/cups/printers.conf that contains <Printer lp_over_ssh> Info HP Laserjet 4100 Location Hennings DeviceURI remote:/ State Idle StateTime 1145777891 Accepting Yes Shared Yes JobSheets none none QuotaPeriod 0 PageLimit 0 KLimit 0 OpPolicy default ErrorPolicy stop-printer </Printer> where the file /usr/lib/cups/backend/remote is a small shell script that says #!/bin/sh cat $6 |sudo -u localuser ssh remoteuser@remotehost lpr
Thanks Johan for reporting this problem
This is not actually a GTK bug; you can remove it. On Ubuntu, cupsd appears runs the backends with user 'cupsys', group 'lp'. You might need to adjust your permissions accordingly, perhaps by making your script other-executable (`chmod o+x`.) Using 'sudo' did not work for me, because it's being run under a different user and there is no console to show the "Password:" prompt. To get this to work, it might require a setuid wrapper of some kind, or your SSH public key to be readable by the invocant process (which I wouldn't recommend.) Cheers, Pete
Ignore that last entry... I didn't read the GNOME part specifically enough. I fixed my bug but not Johan's.
Pete McCormick figured out where the problem lies. In the function cups_request_ppd_cb in modules/printbackends/cups/gtkprintbackendcups.c, there's a check for a PPD file and if the check fails, gtk assumes there's an error somewhere and flags the printer as unavailable. In my case, doing "touch /etc/cups/ppd/lp_over_ssh.ppd" is enough to fix the problem. Thanks, Pete! I'm not sure if this bug should be kept open or closed as NOTABUG. How normal is it for a printer not to have a PPD file?
We recently fixed printing to raw queues (ie without ppd), so I think this should work with current svn. Please reopen if it doesn't.
When we will get a fixed release? The ppd-trick doesn't help.