[cups-devel] [UNKN] STR #4370: When restarting avahi-daemon while CUPS is running, CUPS looses connection

till.kamppeter at gmail.com till.kamppeter at gmail.com
Wed Feb 19 12:11:56 PST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

This is a follow-up to STR #4300

Original issue:

I use CUPS with shared printers and the shared printers are broadcasted by
Avahi. This works well when avahi-daemon is started before cups and both
keep running. But if I restart avahi-daemon while CUPS is running, CUPS
looses connection to avahi-daemon 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 or the admin
changes the configuration of avahi-daemon.

Suggestion for a solution:

While making cups-browsed runnable on-demand on mobile devices I have found
a way to allow avahi-daemon to restart and reconnect. See the section

How to Write a Client That Can Deal with Daemon Restarts

on

http://avahi.sourcearchive.com/documentation/0.6.17/main.html

It is simply passing AVAHI_CLIENT_NO_FAIL to avahi_client_new(). With this
I can run cups-browsed independent of avahi-daemon (not even important in
which order avahi-daemon and cups-browsed are started), and whenever
avahi-daemon is running, remote CUPS printers are detected and the
appropriate local raw queues created and whenever avahi-daemon disappears,
the local queues are taken down. The (re)connection with avahi-daemon
(registering services in case of cupsd has to be done in the client
callback function and so it happens automatically when avahi-daemon
appears.

Perhaps one can use this also for cupsd.

Link: https://www.cups.org/str.php?L4370
Version: 1.7.1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJTBRAMAAoJENujp6sI12IjxaEP/AnuCbkHvvNcznzNXeP/ibHL
Oz2sDpW+7eW7J/AXMNKnSDCbQ4GF5xMHZoZrDEIElLTVlimGhmPFzey1Hs7Wcnu+
hXchv4agjZU5rrCUD6XvGze5rR0tdeA4SpZZM4BkTvMzAJCqCVK3ScebIrjTOOrG
7tHimt1UHXDjTQPUIi9gvWkzvDAN9AA+ntrQ4yMoJ7DQmu6ohGKI4Scl4pxYm5Q0
Leq096Xyb3Pu0ufXXpjzZf1+s9xQQQcnn4z6b74wBqcCYYGlgeikAucNAalyA2zm
/tLz7SkHDwYN991diG0vTP7PdvGbM0eyv5gK2PcZ1K0rI57Bc3zAELQjA0QkSqYb
g+12c6fLWh7xl4QJxvDoeQ1FhNbLsNYbuNJgwZItzEsMbPAshkIzL8FbG17QTsCQ
+VfoRJmcV86OMcyvArfnDxYMhaNJkS5wFOa2aMNlCcTeCNFLYm6123hJroM5VebZ
Lybzx9CemI3AvNJvzbINyVHE9ty9K/rjrefyXJ2obuj5kYKdnvj7xOaH+05KwuTH
0RvfG4oFBc0qyBtqK71MkHb4rvkHh3dOJceUWyBG+TPskkLPRvnz5AzAX1wNlWZC
DJg32JsAUrza097ML7uEiyd5hNIqip3y1GlsFN6n6Yh4+tC+epkuV9LM57r/HF7A
qiQMjsz+6I4c+CkIeSHV
=GH/j
-----END PGP SIGNATURE-----




More information about the cups mailing list