Re: hotplugging /e/n/i "auto" interfaces
--- Per Olofsson <firstname.lastname@example.org> wrote:
> On Thu, Apr 08, 2004 at 18:01 +0200, Oliver Kurth wrote:
> > > If an interface is not present at boot time, /etc/init.d/networking
> > > will still bring it up at boot time if you have marked it auto. It
> > > will of course fail, but the interface will still be listed in
> > > /etc/network/ifstate so that hotplug can't bring it up later.
> > Not any more with ifupdown 0.6.4-4.7 that has been uploadad recently.
> Oh. That's interesting.
> Then I ask the same question as Thomas: does hotplug's
> bring-up-interface-if-auto behaviour cause any harm? If it doesn't,
> I'd like to see that it is made the default.
I think it could cause harm. Suppose you have this /e/n/i:
which brings up lo at boot and all other interfaces on hotplug.
You think that the mapping stanza is ugly and you think that
"auto" _should_ mean "automatically bring up these interfaces"
rather than "automatically bring up these interfaces at boot"
(which is what it meant in the past). So you dpkg-reconfigure
hotplug and put it into hotplug-auto-interfaces mode and you
edit your /e/n/i so it looks like this:
auto lo eth0 eth1 eth2 eth3
Now when you boot your system, S40networking tries to ifup all
these "auto" interfaces. You don't happen to have four interfaces
installed, so ifup -a fails, but you do have one: a PCMCIA ethernet
Now, the driver for this card may have been loaded before this
point. In that case there has already been a hotplug event for
the interface and it has already been brought up. Thus, trying
to bring it up again will fail. I am not sure what follows from
that but let's assume that nothing bad happens, we don't need to
edit any scripts to deal with nonzero exit status, etc.
On the other hand, the driver for the card may not have been
loaded. In that case the attempt to bring up the interface may
induce a modprobe of the driver module. This will cause a hotplug
event and hotplug will run ifup for the interface, causing deadlock
because the interface is already in the process of being ifup'ped.
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now