Bug#409513: [Pkg-utopia-maintainers] Bug#409513: ifup and ifdown slow
becouse of avahi-deamon script
Sjoerd Simons
sjoerd at spring.luon.net
Wed Feb 21 14:56:51 UTC 2007
On Wed, Feb 21, 2007 at 11:32:23PM +0900, Trent Lloyd wrote:
> On Wed, Feb 21, 2007 at 02:28:37PM +0100, Reinhard Tartler wrote:
> > severity 409513 important
> >
> > On Sat, Feb 03, 2007 at 06:58:43PM +0100, Andrzej Zi??ba wrote:
> > > Configuring network interfaces at boot and deconfiguring at shut down
> > > takes 10s or so.
> >
> > I see this as well.
> >
> > > I think that the long time out at system shut down happens because
> > > avahi-daemon script is called from /etc/network/if-post-down.d/ and not
> > > from /etc/network/if-down.d.
> >
> > I rather think this is because /etc/network/if-up.d/avahi-daemon uses
> > the 'host' binary to check if the local system administrator has
> > configured a dns for the '.local' TLD.
> >
> > Please remove this check from that script. A better place would be
> > in preinst of the package. This way, every user of avahi (including
> > depending packages like kdenetwork, ...) has to suffer a 2 sec penalty
> > at boot time.
>
> This check is done at IP up time because this is in no way a once-off
> check, it could vary from network to network
>
> That said being in post-down.d is completely braindead and should be
> removed from there.
Uhm, no post-down is needed to handle the case where you have two or more
network interfaces and avahi has been disabled because a .local domain has been
detected. So if one goes down it might potentially cause a change in dns
settings, thus the recheck is needed to see if we can enable avahi again.
Their are two optimisation which can be done for this. One is to only do the
check when the resolv information actually changes, which is already done by
hooking _only_ into resolvconf if it's available.. A second one could be done
if resolvconf isn't available is to only recheck when avahi is actually
disabled, although this assumes that the changes caused by bringing an
interface down will never cause an nameserver to be added which has a .local.
> On Ubuntu the network interfaces are bought up in the background so it
> doesn't cause any delays I beleive Debian still does this in the
> foreground however, perhaps we can affect the timeout value of 'host'?
Well, manually running ifup on ubuntu also does it in the foreground. But yes,
ifup -a on startup on debian is done in the foreground. Some things which could
be done to optimize this are to _not_ run host when:
* /etc/resolv.conf doesn't list any nameservers
* only lo is up and 127.0.0.1 isn't in /etc/resolv.conf
This helps as host will query localhost (and waits untill the queries timeout)
when there are no nameservers specified.
I did try using -W at some point, but that didn't actually make a difference
for me.
Sjoerd
--
The tree of research must from time to time be refreshed with the blood
of bean counters.
-- Alan Kay
More information about the Pkg-utopia-maintainers
mailing list