Re: restarting pump (DHCP) automatically when network unavailable at boot time
On 2007-07-03 17:44:03 -0600, Bob Proulx wrote:
> Vincent Lefevre wrote:
> > The problem with dhclient is that it disconfigures the loopback
> > interface under some conditions. A bug is still open after 7 years!
> > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=65718
> That bug may still be open but I have never seen it in any
> configuration. I think that bug may no longer be there but no one has
> verified it to root cause and so it has not been closed. There is no
> discussion after the first report. Is anyone else seeing that bug? I
> would guess not.
I saw it 3 years later. See the merged bug 208605
where there is a discussion.
> > Also I need to control whether a DHCP client is running or not,
> Hmm... Usually saying 'iface eth0 inet dhcp' is enough. When
> ifupdown runs it will automatically start the installed dhcp client.
> For me when I did not want that I simply did not configure that device
> as an 'auto' device and then I could control it completely.
It may be enough if you always use DHCP. But there are still networks
> The Etch default is to use network-manager to bring network devices
> online. See /usr/share/doc/network-manager/README.Debian for full
I don't want something graphical.
> > because on another machine (a laptop) I use netenv and DHCP is not
> > used on some networks (BTW, I've already have a "killall pump" in
> > my netenv scripts on this laptop, and I could probably do the same
> > thing with dhclient).
> I have not used netenv and I don't know about it
Description: Configure your system for different network environments
Netenv lets you choose your network environment (and other things)
upon boot, which is useful for notebook computers. The difference to
similar packages is that it doesn't try to autodetect your
environment, but expects your input. You can, however, specify a
default or pass it a parameter from the boot prompt to allow for
unattended boot. You can also use it to switch between environments
Note that there is a timeout, so that the machine will keep the same
network environment if it reboots while I'm not in front of it.
> but I think that maybe you simply need to remove all of the 'auto'
> and 'allow-hotplug' lines from the file. Then it won't be started
But I want it to be started automatically on some networks. This is
very important as I don't always have physical access to my machine.
The netenv utility allows that.
> Then you won't have to kill the dhcp clients.
This is unfortunately wrong. As I've said, there are networks without
DHCP (or one which I don't want to use), on which I need to use
"iface ... inet static". But if a DHCP client is still running (from
the previous environment), it reconfigures the network interface.
I've already had this problem, so I know I must kill the DHCP client.
Also, even if DHCP is always used, letting the network to be reconfigured
automatically when switching network may lead to lost mail for instance,
due to race condition. The correct steps are:
1. Bring the network interface down.
2. Update various configuration files (e.g. the new smarthost for the
3. Bring the network interface up.
in this order. If step 2 is done after step 3, problems can occur.
Vincent Lefèvre <firstname.lastname@example.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)