[Bug 1158686] Re: When restarting avahi-daemon cups does not reconnect to it - workaround
Dmitrijs Ledkovs
launchpad at surgut.co.uk
Fri Mar 22 10:26:55 UTC 2013
Looks correct sequence of events to me, this is avahi-daemon restart:
1 2013-03-22 10:22:12.696810 stopping JOB='avahi-daemon' INSTANCE='' RESULT='ok'
2 2013-03-22 10:22:12.704692 stopping JOB='cups-browsed' INSTANCE='' RESULT='ok'
3 2013-03-22 10:22:12.705150 starting JOB='cups-browsed' INSTANCE=''
4 2013-03-22 10:22:12.705537 started JOB='cups-browsed' INSTANCE=''
5 2013-03-22 10:22:12.705920 starting JOB='avahi-daemon' INSTANCE=''
6 2013-03-22 10:22:12.706322 stopping JOB='cups-browsed' INSTANCE='' RESULT='ok'
7 2013-03-22 10:22:12.706703 starting JOB='cups-browsed' INSTANCE=''
8 2013-03-22 10:22:12.712707 started JOB='cups-browsed' INSTANCE=''
9 2013-03-22 10:22:12.720260 starting JOB='avahi-cups-reload' INSTANCE=''
10 2013-03-22 10:22:12.720981 started JOB='avahi-cups-reload' INSTANCE=''
11 2013-03-22 10:22:12.721324 stopping JOB='avahi-cups-reload' INSTANCE='' RESULT='ok'
12 2013-03-22 10:22:12.721686 stopped JOB='avahi-cups-reload' INSTANCE='' RESULT='ok'
13 2013-03-22 10:22:12.721892 started JOB='avahi-daemon' INSTANCE=''
And this is stop avahi and start avahi:
1 2013-03-22 10:22:12.696810 stopping JOB='avahi-daemon' INSTANCE='' RESULT='ok'
2 2013-03-22 10:22:12.704692 stopping JOB='cups-browsed' INSTANCE='' RESULT='ok'
3 2013-03-22 10:22:12.705150 starting JOB='cups-browsed' INSTANCE=''
4 2013-03-22 10:22:12.705537 started JOB='cups-browsed' INSTANCE=''
5 2013-03-22 10:22:12.705920 starting JOB='avahi-daemon' INSTANCE=''
6 2013-03-22 10:22:12.706322 stopping JOB='cups-browsed' INSTANCE='' RESULT='ok'
7 2013-03-22 10:22:12.706703 starting JOB='cups-browsed' INSTANCE=''
8 2013-03-22 10:22:12.712707 started JOB='cups-browsed' INSTANCE=''
9 2013-03-22 10:22:12.720260 starting JOB='avahi-cups-reload' INSTANCE=''
10 2013-03-22 10:22:12.720981 started JOB='avahi-cups-reload' INSTANCE=''
11 2013-03-22 10:22:12.721324 stopping JOB='avahi-cups-reload' INSTANCE='' RESULT='ok'
12 2013-03-22 10:22:12.721686 stopped JOB='avahi-cups-reload' INSTANCE='' RESULT='ok'
13 2013-03-22 10:22:12.721892 started JOB='avahi-daemon' INSTANCE=''
--
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:
New
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