Bug 202616 - bug with 3rd party LPR breaking s-c-printer
Summary: bug with 3rd party LPR breaking s-c-printer
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: system-config-printer
Version: 4.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Tim Waugh
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-08-15 14:47 UTC by daryl herzmann
Modified: 2007-11-17 01:14 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-08-15 15:00:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description daryl herzmann 2006-08-15 14:47:44 UTC
system-config-printer-0.6.116.5-1  on fully patched EL4.4 x86 box:

/usr/share/printconf/util/cups_import.py  contains this code...

def which_spooler ():
    """Return the name of the active spooler."""
    signal.signal (signal.SIGCHLD, signal.SIG_DFL)
    f = os.popen ('LC_ALL=C /usr/sbin/alternatives --display print')
    for l in f.readlines ():
        if l.startswith (" link currently points to"):
            which = l.split ('.')[1].strip ()
            break

    f.close ()
    return which

the python split line assumes that the lpr binary contains a "." character.  Ex,
lpr.cups .  Our systems use a different version of LPR which doesn't contain
that character and thus the traceback:

# system-config-printer
Traceback (most recent call last):
  File "/usr/sbin/system-config-printer", line 9, in ?
    import queueTree
  File "/usr/share/printconf/util/queueTree.py", line 1236, in ?
    queueTree()
  File "/usr/share/printconf/util/queueTree.py", line 138, in __init__
    if cups_import.import_needed ():
  File "/usr/share/printconf/util/cups_import.py", line 200, in import_needed
    which = which_spooler ()
  File "/usr/share/printconf/util/cups_import.py", line 191, in which_spooler
    which = l.split ('.')[1].strip ()
IndexError: list index out of range

# /usr/sbin/alternatives --display print
<snip>
 link currently points to /usr/athena/bin/lpr
<snip>

This appears to have shown up with the 4.4 update.  Perhaps we could work around
this by renaming the lpr binary and use a "."?

# cd /usr/athena/bin/
# ln -s lpr lpr.isu
# ln -s /usr/athena/bin/lpr.isu /etc/alternatives/print

and that appears to allow system-config-printer to work again....

Thought I would file just to be sure...

thanks!
  daryl

Comment 1 Tim Waugh 2006-08-15 15:00:55 UTC
The system-config-printer application can only configure CUPS, not any 3rd party
spoolers.  Elsewhere there is a test to see whether the link is to 'lpr.cups',
and the application will fail at that point if it is not.

The quoted Python code (checking for output of alternatives) has been present in
system-config-printer since the original release of Red Hat Enterprise Linux 4,
and was not introduced in Update 4.



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