avahi-autoipd causes failure if multiple networking stanzas exist

Bug #84580 reported by Michael Olson
18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
avahi (Debian)
New
Unknown
avahi (Ubuntu)
Fix Released
Medium
Martin Pitt

Bug Description

When I switch from one networking profile to another (by stopping networking, copying new /etc/network/interfaces and other files, and restarting networking), I notice that /etc/network/if-up.d/avahi-autoipd complains about something and exits with status 1, causing the ifup command to stop prematurely before configuring wireless settings. I don't remember the exact error message, but if it is considered important, I can trigger it again.

I've attached the /etc/network/interfaces file which causes the problem.
I suspect the problem may be due to having multiple network interfaces and bridging them (using Shorewall). Adding an "exit 0" to the beginning of /etc/network/if-up.d/avahi-autoipd allows the configuration to succeed, but I would really prefer that the problem be fixed properly.

One way of addressing this would be to put an "exit 0" line at the very end of the file, so that any errors that occur in the "route add" command do not cause the entire configuration process to terminate.

Revision history for this message
Michael Olson (mwolson) wrote :
Martin Pitt (pitti)
Changed in avahi:
assignee: nobody → pitti
importance: Undecided → Medium
status: Unconfirmed → In Progress
Revision history for this message
Michael Olson (mwolson) wrote :

This issue seems to be fixed for me, as of the Feb. 5 upload of avahi in feisty.

Revision history for this message
Michael Olson (mwolson) wrote :

Hmm ... scratch that. The problem is still occurring. Sorry for the mixed response.

Revision history for this message
Martin Pitt (pitti) wrote :

Hm, the latest version does have the 'exit 0' at the end of the file, thus it must fail somewhere else. Can you please add these two lines right after the first one to /etc/network/if-up.d/avahi-autoipd:

  set -x
  exec 2>/tmp/avahi-autoipd.log

and then reproduce the problem? This should create /tmp/avahi-autoipd.log, can you please attach it here?

Changed in avahi:
status: In Progress → Needs Info
Revision history for this message
Pelle van der Scheer (pellesimon) wrote :

This might be related to my problem, I share my internet connection using firestarter

My internet occasionally times out and when I try to reconnect eth0 using ifup eth0 I get:

run-parts: /etc/network/if-up.d/avahi-autoipd exited with return code 2

Ive got the same setup, one static and one dhcp. putting the suggested exit 0 at the beginning of /etc/network/if-up.d/avahi-autoipd lets me use ifup again to bring an interface on. The loss of internet (only resolved by a reboot) seems to occur only after a longer idle without any programs active, ill try to gather more data once it occurs again.

Linux flyingdutchman 2.6.20-15-generic #2 SMP Sun Apr 15 07:36:31 UTC 2007 i686 GNU/Linux

Revision history for this message
yus budiyono (yusbu) wrote :

Perhaps what I experience with Edubuntu goes the same way with this thread.

The situation is we have mixed fixed IP computers and DHCP server at 6th floor and Edubuntu at 3 floor.

The morning following an upgrade from Edgy to Feisty and do apt-get install avahi to know how avahi perform, new computer in 3rd floor cannot find any DHCP server.

I blamed it on the cables, which was true but networking is still in trouble. Problem fixed when I disconnect Edubuntu, remove avahi.

In other office, avahi burdens networking and disturb samba from recognizing other computers.

The two case lead me not to use avahi... :(

Revision history for this message
Eloi Granado (eloi-granado) wrote :

I've just reported the bug 121847, which I believe is related to (or a duplicate of) this one.

Revision history for this message
Igor Goldenberg (igold) wrote :

I have the same as Elio Granado wrote:

igold:~% sudo ifup eth0.4
Set name-type for VLAN subsystem. Should be visible in /proc/net/vlan/config
Added VLAN with VID == 4 to IF -:eth0:-
+ [ eth0.4 != lo ]
+ [ -x /bin/ip ]
+ ip route show dev eth0.4
+ grep ^169.254.0.0/16
+ [ ]
+ /bin/ip route add 169.254.0.0/16 dev eth0.4 metric 1000 scope link
RTNETLINK answers: File exists
run-parts: /etc/network/if-up.d/avahi-autoipd exited with return code 2
igold:~%

Of course I already have route to 169.254.0.0/16 via plain eth0, so adding new one on vlan interface gets error.

Revision history for this message
Wolfgang (wt-lists) wrote :

To fix this problem:

In /etc/network/if-up.d/avahi-autoipd
look for
[ "`ip route show dev $IFACE | grep ^169.254.0.0/16`" ] && exit 0
(should be line 23)

and replace this line with
[ "`ip route show | grep ^169.254.0.0/16`" ] && exit 0

Revision history for this message
Wolfgang (wt-lists) wrote :

The problem is, that there may only be one route for 169.254.0.0/16. So if there is more than one interface the route will probably already exist on the first interface.
The solution is not to set a new route if the route exists on any interface (not only the given one).

To fix this problem:

In /etc/network/if-up.d/avahi-autoipd
look for
[ "`ip route show dev $IFACE | grep ^169.254.0.0/16`" ] && exit 0
(should be line 23)

and replace this line with
[ "`ip route show | grep ^169.254.0.0/16`" ] && exit 0

Changed in avahi:
status: Incomplete → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

This has been fixed in Gutsy a while ago:

avahi (0.6.20-1) unstable; urgency=low

  * New upstream release
  * debian/control:
    + Bump build-depend on libdaemon to (>= 0.11)
    + Add depend on python-dbus to python-avahi (Closes: #426365)
  * debian/avahi-autoipd.{ifup,ifdown}:
    + Check for the existance of link-local routes on all interfaces
      and use some nicer grep rules. Thanks Martin F Krafft and Eloi Granado
      (Closes: #426918)
  * debian/avahi-daemon.preinst:
    + Added. Remove /etc/avahi/etc/{,localtime} on installation, it's should
      no longer be necessary (Closes: #427237)
  * debian/avahi-daemon.init:
    + No longer create /etc/avahi/etc/localtime (Closes: #422368)

 -- Sjoerd Simons <email address hidden> Fri, 06 Jul 2007 14:56:24 +0200

Changed in avahi:
status: Confirmed → Fix Released
Changed in avahi:
status: Unknown → New
Revision history for this message
Eloi Granado (eloi-granado) wrote :

I reported the issue to Debian Bugs alongside to Ubuntu's Launchpad. However, I didn't search well enough for existing bug reports, and created a duplicate one (#121847). I suppose that one should be closed or marked as a duplicate of this one.

Revision history for this message
Mark A. Ziesemer (ziesemer) wrote :

This fix appears to have caused another issue, as reported in bug #425854.

Revision history for this message
fname (an-unused-name) wrote :

This fix does not working and the bug still exists. There is a race condition between the `ip route show` check and the `/bin/ip route add` command, and systemd will launch multiple `ifup` concurrently.
Maybe the failure of `/etc/network/if-up.d/avahi-autoipd` should be ignored to avoid causing problem to ifup/ifdown.
FYI, one can recover from this problem by executing `ip addr flush dev xxx`

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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