Package: ifplugd
Version: 0.26-2
Severity: important

I use ifplugd and guessnet together to have automatic network
configuration for laptops. Usually on boot up when /etc/init.d/ifplugd
is started it will probe for a link beat and when it detects one run
guessnet which then probes for a DSL modem and when that timeouts try
with a DHCP. Usually booting stops until that process is finished
completely so that the network interface is properly setup before
network services are started. This is also the behaviour I observe when
I manually do a "ifdown eth0 ;  ifup eth0". It gives me the next shell
prompt, when it finished all those steps and not before.

But sometimes - I do not yet get when and why - it doesn't wait. In this
case it starts guessnet, but then goes on immediately without waiting
for guessnet to complete the detection of the network environment. This
looks like this:

Here ifplugd starts and correctly detects a link.

Apr 28 11:01:36 somehost ifplugd(eth0)[4279]: ifplugd 0.26 initializing.
Apr 28 11:01:36 somehost ifplugd(eth0)[4279]: Using interface 
eth0/00:0D:60:FF:AB:10 with driver <e1000> (version: 5.6.10.1-k2)
Apr 28 11:01:36 somehost ifplugd(eth0)[4279]: Using detection mode: 
SIOCETHTOOL
Apr 28 11:01:36 somehost ifplugd(eth0)[4279]: Initialization complete,
link 
beat not detected.
Apr 28 11:01:36 somehost kernel: e1000: eth0: e1000_watchdog: NIC Link
is Up 
100 Mbps Full Duplex
Apr 28 11:01:37 somehost ifplugd(eth0)[4279]: Link beat detected.

[...]

Then it executes the ifplugd.action script which tells ifupdown to
configure the network device. 

Apr 28 11:01:38 somehost ifplugd(eth0)[4279]: Executing 
'/etc/ifplugd/ifplugd.action eth0 up'.
Apr 28 11:01:39 somehost ifplugd(eth0)[4279]: client: guessnet: 1
candidate 
profiles
Apr 28 11:01:39 somehost ifplugd(eth0)[4279]: client: guessnet: Starting 
command test subsystem

So far so fine, but now it doesn't wait for guessnet to finish up but
continues with starting services like ntpdate and ntpd. Well and these
fail since the network has not yet been configured completely:

Apr 28 11:01:43 somehost ntpdate[4790]: can't find host some-ntp-server
Apr 28 11:01:43 somehost ntpdate[4790]: can't find host some-ntp-server
Apr 28 11:01:43 somehost ntpdate[4790]: can't find host some-ntp-server
Apr 28 11:01:43 somehost ntpdate[4790]: can't find host some-ntp-server
Apr 28 11:01:43 somehost ntpdate[4790]: no servers can be used, exiting
Apr 28 11:01:44 somehost ntpd[4826]: ntpd [EMAIL PROTECTED]:4.2.0a+stable-2-r 
Sun
Jan  
9 16:13:27 CET 2005 (1)
Apr 28 11:01:44 somehost ntpd[4826]: precision = 2.000 usec

Then while further init scripts are executed guessnet finally gets a
response from pppoe that no DSL modem is available and goes own with
DHCP.

Apr 28 11:01:54 somehost pppoe[4591]: Timeout waiting for PADO packets
Apr 28 11:01:54 somehost dhclient: Internet Software Consortium DHCP
Client 
2.0pl5
Apr 28 11:01:54 somehost ifplugd(eth0)[4279]: client: Internet Software 
Consortium DHCP Client 2.0pl5
Apr 28 11:01:55 somehost dhclient: sit0: unknown hardware address type
776
Apr 28 11:01:55 somehost dhclient: eth1: unknown hardware address type
24
Apr 28 11:01:55 somehost ifplugd(eth0)[4279]: client: sit0: unknown
hardware 
address type 776
Apr 28 11:01:55 somehost ifplugd(eth0)[4279]: client: eth1: unknown
hardware 
address type 24
Apr 28 11:01:55 somehost dhclient: Listening on
LPF/eth0/00:0d:60:ff:ab:10
Apr 28 11:01:55 somehost ifplugd(eth0)[4279]: client: Listening on 
LPF/eth0/00:0d:60:ff:ab:10
Apr 28 11:01:55 somehost dhclient: Sending on
LPF/eth0/00:0d:60:ff:ab:10
Apr 28 11:01:55 somehost ifplugd(eth0)[4279]: client: Sending on   
LPF/eth0/00:0d:60:ff:ab:10
Apr 28 11:01:55 somehost dhclient: Sending on
Socket/fallback/fallback-net
Apr 28 11:01:55 somehost ifplugd(eth0)[4279]: client: Sending on   
Socket/fallback/fallback-net
Apr 28 11:01:55 somehost dhclient: DHCPDISCOVER on eth0 to
255.255.255.255 
port 67 interval 6
Apr 28 11:01:55 somehost ifplugd(eth0)[4279]: client: DHCPDISCOVER on
eth0 to 
255.255.255.255 port 67 interval 6
Apr 28 11:01:55 somehost dhclient: DHCPOFFER from 10.1.254.254
Apr 28 11:01:55 somehost ifplugd(eth0)[4279]: client: DHCPOFFER from 
10.1.254.254

As you can see from the initscript ifplugd is still active. 

I now would like to be able to tell ifplugd to wait until all these
steps are finished before continuing to boot, but did not find an
obvious way to do this.

This is the /etc/network/interfaces I use:

-----------------------------------------------------------------------
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

auto lo
iface lo inet loopback

mapping eth0
        script guessnet-ifupdown
        map default: none
        map timeout: 15
        map verbose: true

iface dsl inet ppp
        provider dsl-provider
        test pppoe

iface none inet dhcp
-----------------------------------------------------------------------

The high map timeout was necessary in order that guessnet waits for
pppoe to complete. I tried running 

cat /etc/network/interfaces | guessnet-ifupdown

several times without a DSL modem connected and it always waited for 
pppoe to complete and then reported "none" so I believe that this part
works reliably.

>From what I read from "man ifplugd" the option "-w" which is passed to
ifplugd by the init script when set in "/etc/default/ifplugd" (as is
default) just tells ifplugd just to wait for the initial link beat 
detection to complete. 

For my understanding that doesn't include the interface configuration
that happens after link beat detection. So it isn't a bug at all the
ifplugd continues before network configuration has finished.

So this bug might only be a wishlist item

But IMHO this still is not sensible when ifplugd is used when services 
are started after /etc/init.d/ifplugd that require the network to 
be there when a network is available (link beat detection succeeds).

Any hints on how to achieve that /etc/init.d/ifplugd will wait until
network configuration is completed? This would be nice and when no link
beat is detected, laptop startup won't be deleted anyway.

Regards,
Martin Steigerwald - team(ix) GmbH - http://www.teamix.de


-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.11.7-bsd-notebook-acpi-2005-03-09
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15) (ignored: 
LC_ALL set to [EMAIL PROTECTED])

Versions of packages ifplugd depends on:
ii  debconf                     1.4.30.13    Debian configuration management sy
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared libraries an
ii  libdaemon0                  0.7-1        lightweight C library for daemons

-- debconf information:
* ifplugd/interfaces: eth0
* ifplugd/hotplug_interfaces:
* ifplugd/args: -q -f -u0 -d10 -w -I
* ifplugd/suspend_action: stop


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to