After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 370685 - Custom CUPS queues don't work
Custom CUPS queues don't work
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-11-04 20:14 UTC by Johan Brannlund
Modified: 2007-06-23 13:44 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16



Description Johan Brannlund 2006-11-04 20:14:17 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
Comment 1 Nickolay V. Shmyrev 2006-11-05 09:03:04 UTC
Thanks Johan for reporting this problem
Comment 2 Pete McCormick 2007-02-25 08:06:07 UTC
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
Comment 3 Pete McCormick 2007-02-25 08:11:32 UTC
Ignore that last entry... I didn't read the GNOME part specifically enough. I fixed my bug but not Johan's.
Comment 4 Johan Brannlund 2007-02-26 01:14:15 UTC
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?
Comment 5 Matthias Clasen 2007-04-30 00:37:58 UTC
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.
Comment 6 Peter Weber 2007-06-23 13:44:52 UTC
When we will get a fixed release? The ppd-trick doesn't help.