Race between avahi-daemon startup by dbus and .local check in if-up.d

Bug #111834 reported by J. Scott Berg
4
Affects Status Importance Assigned to Milestone
avahi (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: avahi-daemon

I am blessed with a unicast .local domain. This should prevent avahi-daemon from running.

The problem is that (probably since I have a static IP address), /etc/network/if-up.d/avahi-daemon is executed before /etc/dbus-1/event.d/25avahi-daemon is ever executed. /etc/network/if-up.d/avahi-daemon checks if avahi-daemon is running, finds that it isn't, and never writes /var/run/avahi-daemon/disabled-for-unicast-local. At a later time, /etc/dbus-1/event.d/25avahi-daemon executes and starts the daemon.

Revision history for this message
J. Scott Berg (jsberg) wrote :

I'm attaching a patch which skips the early test for whether the daemon is running, and creates the DISABLE_TAG before trying to stop the daemon.

Note that there is still a race here: it is possible that avahi-daemon had actually begun to start before DISABLE_TAG was created, but has not reached the point where avahi-daemon -c has indicated that it has actually started. I took the lazy man's approach of putting a 2 second sleep after creating DISABLE_TAG. If avahi-daemon's own locking mechanism is sufficiently robust, this should not be an issue.

Revision history for this message
MrArne (ola-sundvall) wrote :

Hi,
I think you're on right track with your theory. I can confirm it so far that I had a working Avahi running on my laptop with a wireless WEP-encrypted connection, after following advices in these threads: http://ubuntuforums.org/showthread.php?t=378711
 and http://ubuntuforums.org/showthread.php?t=344132. When I suddenly got problems with my connection and tested with a fixed IP adress the Avahi service stopped working, and will not work after going back to DHCP. My question now is how I install/mount/implement your patch?

Thanks in advance

/Ola

Revision history for this message
J. Scott Berg (jsberg) wrote :

The idea of this patch is to DISABLE avahi when it won't work properly. This patch is more likely to disable avahi, so since it seems that you want avahi to be running, my guess is that this is not your problem.

Basically, avahi should be disabled if you need to be able to look up names that end in .local using DNS. You probably know whether or not that is the case.

To determine if this patch will do anything on your network, first do

host -t soa local.

If it returns with

Host local not found: 3(NXDOMAIN)

then this patch will not help you, and avahi should not have any problems related to a unicast .local domain. If it returns something else that looks like

local has SOA record blah.blah. blah.blah. 2 3600 600 604800 86400

Then you have a unicast local. domain. If avahi is not being disabled in this case, you could apply the patch with something like

patch -b -i patchfile /etc/network/if-up.d/avahi-daemon

where patchfile is the name that you saved the patch as. Make sure you save a copy of /etc/network/if-up.d/avahi-daemon before doing this, this patch has not received extensive testing!

Revision history for this message
MrArne (ola-sundvall) wrote :

Oh I see, I'm so engaged in solving the problems with Avahi not running so I interpreted "I am blessed with a unicast .local domain." as an ironic statement, sorry for that... :) - but now I got Avahi working again with help of the procedure described on www.opendns.com. This made my DHCP configuration work again, combined with some effort in defining host and domain names provided from my ISP, which I put into my router (Linksys WRT54GS). Command
host -t soa local
returned
Host local not found: 3(NXDOMAIN) just as you said, so I think I will stay by that for now. In some cases I could find it practical to use static IP addressing though, so I might try it again sometime. Right now I put more value to my mtdaap server on my NAS. This gives me also some doubts to if the widely written avahi problem really is a bug, or if it maybe is more of a case of difficulty-to-tell-how-it-works...
Thanks for leading me in another direction anyway!

Cheers,
Ola

Revision history for this message
Francis De Brabandere (francisdb) wrote :

is this a gutsy problem? I just upgraded to rc1 and avahi now starts instead of showing the 'has been disabled' popup.

Revision history for this message
J. Scott Berg (jsberg) wrote :

I found it in feisty; I'm not sure whether its been addressed in gutsy or not. Basically, if your local network has a .local domain on it, it should NOT start up.

Revision history for this message
Daniel T Chen (crimsun) wrote :

Is this symptom still reproducible in 8.10 beta?

Changed in avahi:
status: New → Incomplete
Revision history for this message
Pedro Villavicencio (pedro) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to New. Thanks again!.

Changed in avahi:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.