Bug 565569

Summary: Lpr and Lpq choose default printer differently
Product: [Fedora] Fedora Reporter: Nadav Har'El <nyh>
Component: cupsAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 12CC: jpopelka, twaugh
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: cups-1.4.2-26.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 569500 (view as bug list) Environment:
Last Closed: 2010-03-12 04:20:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 569500    

Description Nadav Har'El 2010-02-15 16:38:56 UTC
I've been seeing a very strange situation: "lpq" works with my system-default printer, while "lpr" doesn't appear to know what is the default:

$ lpr file
lpr: Error - no default destination available.
$ lpq
p2 is ready
no entries

Obviously, both commands should have either failed (hopefully with a more understandable error message) or succeeded - but the fact that lpq works but lpr doesn't is a bug.

It took me a long time to track down this bug. It turns out that I had an old file ~/.lpoptions in my home directory (left there by some 3 year old Fedora version, apparently), containing the single line "Default Print-to-PDF".

There is no reason why this file should have a different effect on lpq and lpr - so whereas lpq continues to find the system's correct default printer, lpr doesn't. They should either both use the system default printer, or both fail.

I filed a report in the CUPS upstream (see http://www.cups.org/str.php?L3503) and they say it doesn't happen with the upstream version, so it is most likely a Redhat-specific regression.

Version-Release number of selected component (if applicable):
cups-1.4.2-20.fc12.x86_64

See also: bug 481481

Comment 1 Jiri Popelka 2010-02-15 18:00:42 UTC
I created ~/.lpoptions with "Default Print-to-PDF" line, but lpr prints correctly on the default printer (the same as reported with lpq).

Is the problem occuring only when there's ~/.lpoptions or even if you delete it ?

What does 'lpstat -d' say ?

Comment 2 Nadav Har'El 2010-02-16 07:39:33 UTC
The problem goes away when I delete ~/.lpoptions. Note that I do not have a ~/.cups directory, nor a PRINTER - maybe if you have one of those, they are used and not ~/.lpoptions?

I just verified again that the problem still exists:
$ rpm -q cups
cups-1.4.2-20.fc12.x86_64
$ echo Default Print-to-PDF >~/.lpoptions
$ lpr file.pdf
lpr: Error - no default destination available.
$ lpq
$ lpq
p2 is ready
no entries
$ rm ~/.lpoptions
$ lpr file.pdf
<now it actually printed the file>
$

Testing lpstat -d, I see that indeed it also doesn't work:

$ echo Default Print-to-PDF >~/.lpoptions
$ lpstat -d
no system default destination
$ rm ~/.lpoptions
$ lpstat -d
system default destination: p2

I'd settle with with lpr and lpstat consistently not working, although I don't think that a problem in an undocumented configuration file should cause a program to silently not work... It's even more confusing (and what prompted me to post this bug) that lpq does work.

Comment 3 Jiri Popelka 2010-02-16 12:10:22 UTC
Oh, my fault.
Now I see that I created ~/lpoptions (I forgot the dot).
I verify that with
echo Default Print-to-PDF > ~/.lpoptions
lpr and 'lpstat -d' say there's no system default destination.

Comment 4 Fedora Update System 2010-03-02 13:21:51 UTC
cups-1.4.2-33.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/cups-1.4.2-33.fc13

Comment 5 Fedora Update System 2010-03-03 01:47:33 UTC
cups-1.4.2-33.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update cups'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F13/FEDORA-2010-3343

Comment 6 Fedora Update System 2010-03-05 11:08:13 UTC
cups-1.4.2-26.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/cups-1.4.2-26.fc11

Comment 7 Fedora Update System 2010-03-05 11:30:27 UTC
cups-1.4.2-28.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/cups-1.4.2-28.fc12

Comment 8 Fedora Update System 2010-03-05 13:34:18 UTC
cups-1.4.2-33.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2010-03-12 04:19:54 UTC
cups-1.4.2-28.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2010-03-13 02:29:02 UTC
cups-1.4.2-26.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.