Comment 25 for bug 624043

Revision history for this message
Jussi Sainio (jussi-sainio) wrote :

Ubuntu 12.04, a DHCP configured local network, and the same problem. Putting lines to rc.local was not clean enough solution for me, so I investigated this a little bit further. I had following symptoms:

/var/log/boot.log:
 * Starting mDNS/DNS-SD daemon [OK]
 * Stopping mDNS/DNS-SD daemon [OK]
[...]
 * Starting configure network device [OK]

/var/log/syslog:
Dec 17 14:01:03 riesling avahi: Avahi detected that your currently configured local DNS server serves a domain .local. This is inherently incompatible with Avahi and thus Avahi disabled itself. If you want to use Avahi in this network, please contact your administrator and convince him to use a different DNS domain, since .local should be used exclusively for Zeroconf technology. For more information, see http://avahi.org/wiki/AvahiAndUnicastDotLocal
Dec 17 14:01:03 riesling dhclient: bound to 192.168.3.130 -- renewal in 40304 seconds.

/var/log/upstart/avahi-daemon.log:
Process 857 died: No such process; trying to remove PID file. (/var/run/avahi-daemon//pid)

(Side note: I hate the lack of timestamps in the two log files. Does anybody know a solution to this?)

While this can be mitigated by disabling the "detect .local" check in /etc/default/avahi-daemon ...:

AVAHI_DAEMON_DETECT_LOCAL=0

...this is a "wrong" (but working) fix, since my network DNS does not serve .local domain as far as I know. Note that in the logs, the network device is brought up after trying starting Avahi. This means that the "detect .local" check is not even done on the actual LAN device, maybe just on the loopback device or on no network devices at all. If we want this "detect .local" feature to work (sounds like a good idea on e.g. mobile zeroconf daemons such as laptops), Avahi daemon must be started after bringing up the network devices.

One a little bit more kosher way to accomplish this, by patching /etc/init/avahi-daemon.conf:

start on (filesystem
          and started dbus and net-device-up IFACE!=lo)

Now, the avahi-daemon starts only after the first non-loopback network device has been brought up and the "detect .local" check should be done there correctly without failing every time.

(Note: I do not know how avahi-daemon works in a changing network scenario, e.g. if it runs on a laptop and the laptop changes network without rebooting. Somebody maybe can test this scenario out and make the avahi-daemon restart on each net-device-up/down event, if avahi-daemon does not handle this internally. My setup is a server on a home network.)