Bug 105402 - Duplicate "Listen" in cupsd.conf (even after bugfix 88303)
Summary: Duplicate "Listen" in cupsd.conf (even after bugfix 88303)
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: redhat-config-printer   
(Show other bugs)
Version: 9
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2003-09-25 19:04 UTC by Philip Spencer
Modified: 2007-04-18 16:57 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-05-12 04:42:13 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2004:071 normal SHIPPED_LIVE Updated printer configuration tool fixes sharing problems 2004-05-12 04:00:00 UTC

Description Philip Spencer 2003-09-25 19:04:20 UTC
Description of problem:

With two ethernet interfaces, any attempt to set up a printer to share to two
subnets produces a duplicate "Listen" line in /etc/cups/cupsd.conf.

In our case we have eth0 (subnet and eth1 (private Initially we had cups set to listen to @IF(eth0)
and @IF(eth1) - that all worked fine. Then we decided it would be better to swit
ch to explicitly specifying the IP subnets, in case we later add virtual
interfaces. So instead of one "Ethernet eth0 and eth1" line in the configuration
tool, we added two lines: one for and the
other for This produced the following cupsd.conf:

Listen       <---- duplicate!

Note - this is different from bug 88303. I am already running the errata version which contains a fix for that bug.

The problem is the following section of code in util/backend.py:

# Interfaces to listen on
if len (ipaddr) != 1 or ipaddr[0] != "*":
    cupsd_conf_lines.append ("Listen\n")

for each in ipaddr:
    cupsd_conf_lines.append ("Listen %s:631\n" % each)

If "" shows up in the ipaddr list, there will be a duplicate Listen
line generated. This causes cupsd to crash and refuse to start until the
/etc/cups/cups.conf file is fixed by hand. The fix for bug 88303 eliminates
duplicates in ipaddr but it doesn't eliminate from that list.

I have resolved the problem on our site by changing the above lines to:

# Interfaces to listen on
wrote_localhost = 0
if len (ipaddr) != 1 or ipaddr[0] != "*":
    cupsd_conf_lines.append ("Listen\n")
    wrote_localhost = 1

for each in ipaddr:
    if each != "" or not wrote_localhost:
        cupsd_conf_lines.append ("Listen %s:631\n" % each)

This resolves the problem; however, I'm still not sure that the logic of writing
a separate "Listen" line is correct in the first place ...

Comment 1 Tim Waugh 2003-09-29 12:25:56 UTC
I can't seem to reproduce this problem unless I explicitly list as a network interface to listen on.  Is that what
you've done?

Comment 2 Tim Waugh 2003-10-02 12:12:34 UTC
(I'm afraid your reply got lost from bugzilla due to a hardware problem; I had a
copy in my mailbox though:)

No. I simply shared out the printer to two subnets, on different ethernet

Here is a procedure to duplicate the problem (which really shouldn't be
necessary; just look at the code! It shows quite clearly how the two lines
get added).

  * Install two ethernet cards in a machine.
  * Install RedHat Linux 9. Assign IP addresses A.B.C.D and E.F.G.H to the
    two network cards.
  * Upgrade to latest errata
  * Run redhat-config-printer
  * Add a local printer and click Apply.
  * Choose "Sharing" from the Action menu for that printer.
  * Remove the default "All Hosts" entry.
  * Add an entry and specify the firs subnet IP address and mask:
  * Add a second entry for the second subnet:
  * Click Apply.

The cupsd.conf file now has two "Listen" lines.

And here is another bug: when I do it this way, there is no listen line for
A.B.C.D, just for E.F.G.H! Unless I also explicitly turn on sharing to the
ethernet card via @IF(eth0) as well!

Comment 3 Tim Waugh 2003-10-02 12:13:53 UTC
If possible, could you try redhat-config-printer-0.6.76-1, which is in rawhide
at the moment?  It contains further fixes in this area, and I'd like to verify
that it fixes the original problem.

Comment 4 Philip Spencer 2003-10-02 16:44:36 UTC
Yes, the new redhat-config-printer-0.6.76-1 does fix the original problem.

It also seems to fix the second problem I noticed when making the previous
reply. Now both subnet IP addresses get listed as they should (instead of just
the second one), and the localhost address gets listed just once as it
should (instead of twice).


Comment 5 Tim Waugh 2003-10-03 15:25:37 UTC
Fixed in CVS.

Comment 6 John Flanagan 2004-05-12 04:42:13 UTC
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.


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