Bug 195532 - Since upgrading from FC4 to FC5 "lpr file" always prints in Landscape
Since upgrading from FC4 to FC5 "lpr file" always prints in Landscape
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: cups (Show other bugs)
5
All Linux
medium Severity high
: ---
: ---
Assigned To: Tim Waugh
:
: 194580 (view as bug list)
Depends On:
Blocks: FC6Target
  Show dependency treegraph
 
Reported: 2006-06-15 12:11 EDT by Tim Waugh
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-01 18:50:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
/etc/cups/printers.conf file (346 bytes, text/plain)
2006-06-20 08:50 EDT, Kern Sibbald
no flags Details

  None (edit)
Description Tim Waugh 2006-06-15 12:11:40 EDT
[Restored from email; originally bug #194580]

Description of problem:
If I send a file to my Postscript printer directly with "lpr filename", it 
always prints the output in Landscape orientation rather than Portrait.

Version-Release number of selected component (if applicable):
FC5
cups-1.2.1-1.9

How reproducible:
Print any file using the "lpr" command.  Note, if I print using OpenOffice or 
Konqueror, the output is formatted correctly.

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
This is a network printer Dell 3100cn, and in checking all the places I know 
(control panel, web access to the printer) for setting the orientation, they 
are all set to Portrait, including the values stored in the printer.  The 
printer has worked perfectly fine for a long time under FC4.

I defined this same printer on a different FC5 that was installed rather than 
upgraded, and it works just fine, so that implies something got messed up in 
the upgrade.

I removed /etc/cups, reinstalled all the cups rpms using --force, and 
redefined the printer using the ppd from the FC5 system where printing works 
correctly, but the problem still exists -- all "lpr filename" commands print 
in Landscape.
Comment 1 Tim Waugh 2006-06-15 12:12:48 EDT
What does 'lpoptions' say?
Comment 2 Kern Sibbald 2006-06-19 13:26:09 EDT
# lpoptions
job-sheets=none,none printer-info='Dell 3100cn printer' 
printer-is-accepting-jobs=1 printer-is-shared=1 printer-make-and-model='Dell 
3100cn printer' printer-state=3 printer-state-change-time=1150270156 
printer-state-reasons=none printer-type=13


PS: I've been in bed since Thur with a nasty virus, which is why I was slow at 
responding.  
Comment 3 Tim Waugh 2006-06-20 06:14:54 EDT
*** Bug 194580 has been marked as a duplicate of this bug. ***
Comment 4 Tim Waugh 2006-06-20 06:24:37 EDT
Does 'lpr /usr/share/cups/data/testprint.ps' also come out portrait?

Please attach /etc/cups/printers.conf.  Thanks.
Comment 5 Kern Sibbald 2006-06-20 08:47:17 EDT
Does 'lpr /usr/share/cups/data/testprint.ps' also come out portrait?  No, it 
comes out in landscape.  If I print the same filename on a newly installed FC5 
machine (rather than my upgraded development machine), it prints in Portrait.

Also, on the newly installed FC5 machine, the output from lpoptions is 
different:
# lpoptions -p Dell
job-sheets=none,none printer-info='Dell 3100cn printer' 
printer-is-accepting-jobs=1 printer-is-shared=1 printer-make-and-model='Dell 
3100cn printer' printer-state=3 printer-state-change-time=1150220468 
printer-state-reasons=none printer-type=4180

In particular, the printer-type is 4180 rather than 13.  I don't know what 
that means.  I'll see if I can read up on lpoptions and if I can change the 
type, I'll see if that has any effect.

I'll attach the printers.conf file next.
Comment 6 Kern Sibbald 2006-06-20 08:50:23 EDT
Created attachment 131183 [details]
/etc/cups/printers.conf file
Comment 7 Kern Sibbald 2006-06-20 08:58:43 EDT
Well, doing:

lpoptions -o printer-type=4180

seems to have corrected the problem.  

As far as I am concerned you can close the bug.  

However, I would really like to know what the printer-type codes mean and why 
would it have been messed up during the upgrade of my machine?  Also, it would 
be good to know where these values are stored as it seems they are not 
in /etc/cups since I deleted that file and it was re-created during the forced 
re-install of the cups rpms.
Comment 8 Tim Waugh 2006-06-20 09:16:55 EDT
No, that's not what you're meant to do!  Don't touch the printer-type attribute;
it's automatically generated.

Did you do that command as root, or as a normal user?  I'd like to undo it so
that we can continue debugging.
Comment 9 Kern Sibbald 2006-06-20 10:51:35 EDT
Yes, I figured it was automatically generated.  

Yes, I did the command as root, as I do with any command that I know will be 
digging into system files.

I've set printer_type back to 13, which causes the problem to re-appear for 
both text files and the printer test ps page.

Let me know what you need to debug it.

At least I know how to fix it when I need to print -- it is incredibly 
(amazingly) annoying to try to read normal text in landscape.
Comment 10 Tim Waugh 2006-06-20 12:32:56 EDT
What does 'cat /etc/cups/lpoptions' say now?  If it has a printer-type attribute
in it anywhere, please remove it.
Comment 11 Kern Sibbald 2006-06-20 17:07:24 EDT
It has exactly one line that reads:

Default Dell printer-type=13

Do you want me to delete the whole line?  The whole file?

Note, on the machine that works, there is no /etc/cups/lpoptions file.
Comment 12 Tim Waugh 2006-06-22 07:00:01 EDT
Please remove the file.

So, now that's been undone.

What does 'lpstat -s' say?
Comment 13 Kern Sibbald 2006-06-22 08:51:29 EDT
After deleting /etc/cups/lpoptions 'lpstat -s' says the same thing as before:
system default destination: Dell
device for Dell: socket://192.168.68.102

In addition, 'lpoptions' no reports:
job-sheets=none,none printer-info='Dell 3100cn printer' 
printer-is-accepting-jobs=1 printer-is-shared=1 printer-make-and-model='Dell 
3100cn printer' printer-state=3 printer-state-change-time=1150980929 
printer-state-reasons=none printer-type=135252

and printing seems to work fine either directly printing a text file or 
printing the printer test page (ps).
Comment 14 Tim Waugh 2006-06-22 10:12:44 EDT
So the landscape problem is gone?
Comment 15 Kern Sibbald 2006-06-22 10:40:39 EDT
Yes, when I deleted /etc/cups/lpoptions, the Landscape problem went away.
Comment 16 Tim Waugh 2006-06-22 12:28:54 EDT
How strange.  Well, probably CUPS should prevent the user from explicitly
setting the printer-type attribute; I can only think that that was the original
problem somehow(!).
Comment 17 Tim Waugh 2006-06-22 12:32:27 EDT
Filed upstream:
  http://cups.org/str.php?L1791
Comment 18 Kern Sibbald 2006-06-22 13:20:32 EDT
The only time I explicitly set anything on this printer was during the bug 
reporting and I noted everything I did.  If you think that was the original 
problem, I imagine you must have a hard time resolving bugs because that is 
not a logical conclusion from what you have seen during this bug reporting.

I think your suggestion to prevent the user from setting the printer-type 
attribute would block a means for the user to correct a bug that exists 
someplace in the rpm upgrade code.
Comment 19 Tim Waugh 2006-06-22 13:46:57 EDT
Well, comment #2 showed me that you had 'printer-type=13' originally, and
comment #13 shows me that without an lpoptions file to corrupt it the correct
value is 135252, so I think you can see why I still believe the conclusion to be
plausible.

Incidentally, these numbers are bit-fields, and convey information about whether
the printer is local or remote, what capabilities it has, etc.
Comment 20 Kern Sibbald 2006-06-25 13:14:33 EDT
Just to let you know that the problem is back (everything is printing in 
Landscape except programs that explicitly set the orientation).  I don't know 
why, perhaps because my machine froze and I rebooted it. Anyway, nothing I do 
corrects the problem.

This is probably not worth debugging because I have given up on Fedora. As 
soon as I find a suitable distro, I will be blasting FC5 into history ...
Comment 21 Kern Sibbald 2006-07-01 15:03:26 EDT
As I am now switching distros, I was in the process of cleaning out all 
my .xxx files, and I found what was causing the bug.  I leave it to you to 
determine how it got that way and why I couldn't reset it using the standard 
configure programs.

The file .lpoptions contained:

Dest Brother
Default Dell PreFilter=Level1 orientation-requested=4
Special Advanced%20Faxing%20Tool%20(ksendfax)
Special Mail%20PDF%20File
Special Print%20to%20File%20(PDF)
Special Print%20to%20File%20(PostScript)
Special Send%20to%20Fax


Once I removed orientation-requested=4, the printer prints correctly in 
portrait.
Comment 22 Tim Waugh 2006-07-01 18:50:10 EDT
Oh, you ran 'lpoptions' as root rather than the user submitting the job then, in
comment #2.

Note You need to log in before you can comment on or make changes to this bug.