Bug 202616 - bug with 3rd party LPR breaking s-c-printer
bug with 3rd party LPR breaking s-c-printer
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: system-config-printer (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Depends On:
  Show dependency treegraph
Reported: 2006-08-15 10:47 EDT by daryl herzmann
Modified: 2007-11-16 20:14 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-08-15 11:00:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description daryl herzmann 2006-08-15 10:47:44 EDT
system-config-printer-  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 ()

    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 ?
  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
 link currently points to /usr/athena/bin/lpr

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...

Comment 1 Tim Waugh 2006-08-15 11:00:55 EDT
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.