[FFE] Reimplement automatic appearing of CUPS queues broadcasted by a remote CUPS server

Bug #1061063 reported by Jonathan Ernst on 2012-10-03
This bug affects 8 people
Affects Status Importance Assigned to Milestone
cups (Ubuntu)
Till Kamppeter
Till Kamppeter
Till Kamppeter
cups-filters (Ubuntu)
Till Kamppeter
Till Kamppeter

Bug Description

Feature Freeze Exception request for Quantal

Original report:

Since cups 1.6+, cups browsing protocol and automatic appearing of remote CUPS queues doesn't work anymore (LP: #1052897).

This is a serious regression because each user has to :

- manually add each queue of interest at every site (as printers don't appear automagically anymore)
- keep a big list of non existing printers when moving (as printers don't disappear automagically anymore)

The local cups server (or another daemon) should have a mean to automatically add discovered printers (like it does for USB printers for example).


The feature of CUPS servers broadcasting their print queue info into the local network and CUPS clients automatically picking up these broadcasts and making the queues immediately available and so the client always automatically having the print queues of the network where it is actually connected is unique to Linux and makes users prefer Linux against Windows or Mac.

Clients are absolutely configuration-less. They simply pick up the queues in the network. Roaming with a laptop between different networks (home, office) always shows the printers actually available.

In addition, it is very easy to set up high availability. Create equally-named queues on more than one server (preferably with the same printer model and configuration) and on clients only one queue (an implicit class) with this name appears and jobs get load-balanced between the servers and the queue stays alive if a part of the servers is down.

As all this is done by CUPS itself, it works with all desktop applications and on the command line. No special code in the print dialogs is needed.

CUPS 1.6.x dropped this feature, replacing CUPS' own broadcasting/browsing functionality by broadcasting via Bonjour (avahi-daemon). CUPS 1.6.x has no client-side browsing functionality to automatically pick up the Bonjour-bnroadcasted queues. According to upstream it requires the discovery being implemented in the application's/GUI toolkit's print dialogs, there is even a set of functions in libcups for it, but they are not used by CUPS itself.

Proposed fix:

In the package cups 1.6.1-0ubuntu10 I have forward-ported the removed CUPS broadcasting/browsing feature from cups 1.5.x to cups 1.6.x basing myself on the upstream SVN commits 10104, 10113, and 10544 undoing them (but without SLP and LDAP support). The patch is very large, but

- It contains only code which worked well for several years in CUPS
- The patch does not interfere with any changes on CUPS which were done after the removal of the CUPS Broadcasting/Browsing functionality.
- It does not remove anything from the current code and also does not modify anything of the already existing functionality (like Bonjour broadcasting/AirPrint support).
- I have tested it on 2 computers, one 64-bit with 17 queues and one 32-bit with one queue, having an additional Precise (CUPS 1.5.3) box in the network (~15 queues). All broadcast and receive their queues correctly and all network printing works. Equally named queues form implicit classes as expected. Left everything running over night and no crash reports in the morning (patch for bug 1041013 is also applied).
- Consumers of libcups, especially GTK work without problems, so no other packages need to get rebuilt.
- Eliminates the need to do changes on several GUI toolkit and application packages.
- All bug fixes of 1.6.1 and after are preserved (in contrary to a downgrade to CUPS 1.5.x).

Additional notes:

We will not carry this large patch permanently. It is only until the GUI toolkits and print dialogs are able to discover Bonjour-broadcasted print queues and so configuration-less clients are possible without classic CUPS Broadcasting/Browsing. This we want to achieve in Quantal+1 (13.04) and so we do not need to carry this patch over to later CUPS versions.

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: cups 1.6.1-0ubuntu9

[ Automatically added info not relevant for this problem removed ]

Jonathan Ernst (jonathan.ernst) wrote :
Changed in cups (Ubuntu):
importance: Undecided → High
milestone: none → ubuntu-12.10
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cups (Ubuntu):
status: New → Confirmed
summary: - Reimplement automatic appearing of remote CUPS queues brodcasted by DNS-
- SD/Bonjour
+ Reimplement automatic appearing of remote CUPS queues broadcasted by
+ DNS-SD/Bonjour
Changed in cups (Ubuntu):
assignee: nobody → Till Kamppeter (till-kamppeter)
importance: High → Critical
status: Confirmed → In Progress

Fix committed in cups 1.6.1-0ubuntu10 in quantal-proposed.

Changed in cups (Ubuntu):
status: In Progress → Fix Committed
summary: - Reimplement automatic appearing of remote CUPS queues broadcasted by
- DNS-SD/Bonjour
+ [FFE] Reimplement automatic appearing of CUPS queues broadcasted by a
+ remote CUPS server
description: updated
description: updated
description: updated
description: updated
description: updated
Scott Kitterman (kitterman) wrote :

Ack. FFe approved.

Till Kamppeter (till-kamppeter) wrote :

See also bug 1061069 about this problem.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cups - 1.6.1-0ubuntu10

cups (1.6.1-0ubuntu10) quantal-proposed; urgency=low

  * debian/patches/forward-port-cups-1-5-x-cups-browsing.patch: Re-introduced
    CUPS Browsing/Broadcasting for automatic discovery of shared CUPS printers
    on the local network. We will keep this for the Quantal cycle until we
    get automatic discovery of Bonjour-broadcasted printers, which most
    probably needs to be implemented in the application's print dialogs. This
    will only be possible to be done in Quantal+1 (13.04). The patch is large
    but all code added worked very well in many generations of CUPS and the
    code added back in smoothly without need of alterations of the existing
    code (LP: #1061063, LP: #1061069).
  * debian/rules: Set "./configure" arguments
    "--with-local_protocols='CUPS dnssd' --with-remote_protocols='CUPS dnssd'"
    to make the re-introduction of CUPS Browsing/Broadcasting work correctly.
  * debian/cups.postinst: Do not remove the "Browse..." keywords from cupsd.conf
    any more as we have re-introduced the Browsing/Broadcasting functionality.
  * debian/patches/fix-another-spot-where-avahi-crashes-cupsd-because-it-does-not-handle-null-values-from-its-own-apis.patch:
    Fix another spot where Avahi crashes cupsd because it does not handle NULL
    values returned by its own APIs (CUPS STR #4200, LP: #1041013).
  * debian/patches/ipp-backend-did-not-send-cancel-request-to-printers-when-a-job-was-canceled-and-printer-did-not-support-create-job.patch:
    The IPP backend did not send a cancel request to printers when a job was
    canceled and the printer did not support Create-Job. This is to improve the
    "ipp" backend as much as possible to reduce the ned of the "ipp14" backend
    ("ipp" backend of CUPS 1.4.x added to the Debian/Ubuntu package as fallback
    in case of regressions of the current "ipp" backend).
 -- Till Kamppeter <email address hidden> Fri, 5 Oct 2012 20:56:30 +0200

Changed in cups (Ubuntu):
status: Fix Committed → Fix Released

I can confirm that everything is working as before. Thanks a lot for this fix.

Jonathan Ernst (jonathan.ernst) wrote :

Thanks a lot Till for your very fast and efficient reaction! I can confirm that cups queue discovery works again.

Sascha Steinbiss (satta) wrote :

Hmm. In pure client mode (only ServerName set in client.conf) I still do not get any remote printers from a CUPS 1.5.1 server. The same setup worked fine in 12.04. Did I miss something? I'm on the latest quantal cups (1.6.1-0ubuntu11) already.

Sascha, please really file a new bug for that as this mode has nothing to do with CUPS Broadcasting/Browsing. Please attach the error_log of the server (following https://wiki.ubuntu.com/DebuggingPrintingProblems#CUPS_error_log) to your new bug report.

On the client run the command

sudo nmap <server name>

with <server name> replaced by what you have set as the ServerName in your client's client.conf and post the output in the new bug report. Install nmap via

sudo apt-get install nmap for the case that it is not present on your system.

Also attach your client's client.conf to the new bug report.

Sascha Steinbiss (satta) wrote :

done -- see #1069671

I have now released cups-filters 1.0.26 upstream, with the new cups-browsed daemon added. cups-browsed browses the Bonjour broadcasts of shared remote CUPS queues and makes the queues available locally, eliminating the need of the forward-port patch for CUPS broadcasting/browsing. As soon as this package is available in Raring I will remove the patch from Raring's CUPS.

Changed in cups (Ubuntu Quantal):
status: New → Fix Released
importance: Undecided → Critical
assignee: nobody → Till Kamppeter (till-kamppeter)
Changed in cups (Ubuntu Raring):
status: Fix Released → Triaged
Changed in cups-filters (Ubuntu Quantal):
status: New → Invalid
Changed in cups-filters (Ubuntu Raring):
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → Till Kamppeter (till-kamppeter)
Changed in cups (Ubuntu Raring):
milestone: ubuntu-12.10 → ubuntu-13.04-feature-freeze
Changed in cups-filters (Ubuntu Raring):
milestone: none → ubuntu-13.04-feature-freeze
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cups - 1.6.1-0ubuntu13

cups (1.6.1-0ubuntu13) raring; urgency=low

  * debian/patches/forward-port-cups-1-5-x-cups-browsing.patch: Removed the
    forward-port of CUPS broadcasting/browsing as from cups-filters 1.0.27
    on we have cups-browsed which does Bonjour browsing for us making the
    patch unneeded. This eliminates also a crash bug in cupsd (LP: #1086019,
    LP: #1061063, LP: #1061069).
  * debian/rules: Removed "--with-remote_protocols='CUPS dnssd'" from the
    ./configure command line and removed the "CUPS" from
    "--with-local_protocols='CUPS dnssd'". These settings are not supported
    any more in stock CUPS 1.6.x (without forward-port of CUPS broadcasting/
  * debian/cups.postinst: Again clean /etc/cups/cupsd.conf from all keywords
    and settings which got obsolete with the dropping CUPS Broadcasting/
    Browsing in CUPS 1.6.x: BrowsePoll, BrowseAllow, BrowseDeny, BrowseOrder,
    and BrowseRemoteProtocols lines get removed and the "cups" argument gets
    removed from the BrowseLocalProtocols line.
  * debian/patches/airprint-support.patch,
    Refreshed with quilt.
  * debian/patches/CVE-2012-5519.patch: Manually updated.
 -- Till Kamppeter <email address hidden> Fri, 28 Dec 2012 22:27:30 +0100

Changed in cups (Ubuntu Raring):
status: Triaged → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cups-filters - 1.0.28-0ubuntu1

cups-filters (1.0.28-0ubuntu1) raring; urgency=low

  * New upstream release
     - cups-browsed: Added daemon to browse the Bonjour broadcasts of
       shared remote CUPS printers and automatically add local raw queues
       pointing to them, to resemble the behavior of the former CUPS
       broadcasting/browsing which was dropped in CUPS 1.6. Now remote
       printers appear as local print queues as before, but with the
       standardized Bonjour broadcasting (LP: #1086019, LP: #1061063,
       LP: #1061069).
  * debian/control: Added build dependencies on Avahi, needed for the new
    cups-browsed and also a new binary package named cups-browsed.
  * debian/cups-browsed.install: New cups-browsed binary package.
  * debian/local/cups-browsed.upstart: Upstart configuration file for
  * debian/rules: Added everything needed so that the cups-browsed daemon gets
    started automatically.
  * debian/cups-filters.install: Include files from /usr/bin.
 -- Till Kamppeter <email address hidden> Sat, 29 Dec 2012 14:30:07 +0100

Changed in cups-filters (Ubuntu Raring):
status: Triaged → Fix Released

For configuring the browsing behavior, especially if you have old machines (CUPS 1.5.x or earlier) in your network, edit


and restart cups-browsed with

sudo restart cups-browsed

See the comments in cups-browsed.conf and


Do not use legacy CUPS broadcasting and browsing if your network has only CUPS 1.6.x (and Ubuntu CUPS 1.5.x servers).

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers