[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: restarting pump (DHCP) automatically when network unavailable at boot time



Vincent Lefevre wrote:
> Bob Proulx wrote:
> > 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
> 
>   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=208605
> 
> where there is a discussion.

Good information.  Thanks for posting that pointer.

> It may be enough if you always use DHCP. But there are still networks
> without DHCP.

Of course.

> > The Etch default is to use network-manager to bring network devices
> > online.  See /usr/share/doc/network-manager/README.Debian for full
> > details.
> 
> I don't want something graphical.

Being a non-graphical person myself I can't argue with that.

> Description: Configure your system for different network environments

There are actually a large number of network configuration packages
and they have pluses and minuses to each of them.  I don't think there
is one size fits all for any of them.  Some will intrinsically work
better in some situations than others will.

> > 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
> > automatically.
> 
> 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.

Personally I think *only* starting it on networks that will use it
makes more sense than *always* starting it and killing it off if the
configuration decides this is not a dhcp network.  However it is just
a program and if killing it off works better for you then go for it.

> The netenv utility allows that.

Sounds good.

> > 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".

As stated I disagree that it is "wrong".  If you need it then run it.
If you don't need it then don't run it.  In your case if you want to
start it then decide it needs to be stopped then okay too.  Browsing
through the alternative packages that are available will show that
many people have different ideas on the best way to get the job done.

> 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.

This sounds like new information.  I am used to always getting to a
clean state and then moving through the state diagram to the desired
state for that network.  Dragging forward a previous state would be
different.  But I don't think it is worth hashing out the details
here.  You understand what is going on for your situation.  I think
you have it working for you.  Life sounds good!  :-)

> 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
>    mail).
> 3. Bring the network interface up.
> 
> in this order. If step 2 is done after step 3, problems can occur.

I believe that is fairly standard in Etch.  See the /etc/network/*.d/*
files for postfix for example.

Bob



Reply to: