[Bug 1158686] Re: When restarting avahi-daemon cups does not reconnect to it - workaround

Till Kamppeter 1158686 at bugs.launchpad.net
Mon Apr 29 09:16:54 UTC 2013


Mauro, I was assuming that printer broadcasting via Avahi does not work
for you. Your cupsd.conf makes the impression to me that your CUPS is
not sharing your printers and that you perhaps need to adjust your
configuration.

If your printers are actually broadcasted and your only problem is the
ugliness of a failed second attempt to restart CUPS reported in the logs
the problem is much less severe (your printing functionality is fully
available) and an Upstart expert has to look into this issue.

What is your situation? Are your printers still no broadcasted, even
after following the instructions of comment #19?

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to avahi in Ubuntu.
https://bugs.launchpad.net/bugs/1158686

Title:
  When restarting avahi-daemon cups does not reconnect to it -
  workaround

Status in “avahi” package in Ubuntu:
  Fix Released

Bug description:
  I use CUPS with shared printers and the shared printers are Bonjour-
  broadcasted by Avahi. This works well when avahi-daemon is started
  before cups and both keep running. But if I restart (stop and start
  gain) avahi-daemon while CUPS is running, CUPS does not reconnect to
  avahi-daemon again and so stops broadcasting. What I expect is that
  CUPS reconnects after the restart of avahi-daemon. This can easily
  happen if for example the avahi-daemon package gets updated, avahi-
  daemon crashes, or the admin changes the configuration of avahi-
  daemon.

  I am using Ubuntu Raring (13.04) with CUPS 1.6.2.

  The real fix would need to be done in CUPS and therefore I did the
  following upstream bug report:

  https://www.cups.org/str.php?L4300

  For the time being until CUPS gets fixed I suggest the following
  workaround:

  If one adds the following lines to the end of the /etc/init/avahi-
  daemon.conf file

  ----------
  post-start script
      if lpstat -h localhost -r 2>/dev/null | grep -qv not; then
          killall -HUP cupsd
      fi
  end script
  ----------

  the CUPS daemon gets kicked after starting avahi-daemon and so
  reconnects. The "if" only comes true if "lpstat" is present and the
  answer of "lpstat -h localhost -r" does not contain "not", meaning
  that the CUPS daemon is running.

  This works at least for restarting the avahi-daemon by "stop avahi-
  daemon; ...; start avahi-daemon" (what happens when updating avahi-
  daemon) or by the "respawn" (what happens when avahi-daemon crashes).

  It does not work with "restart avahi-daemon". Any addition to my
  suggested workaround to make this work is welcome.

  Can this workaround be applied to Raring? Thanks.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/avahi/+bug/1158686/+subscriptions




More information about the foundations-bugs mailing list