Subject: Re: How to detect net cable plug-in
To: Jason Thorpe <>
From: Brian Grayson (home) <>
List: tech-net
Date: 10/14/2003 10:10:44
On Mon, Oct 13, 2003 at 11:39:42PM -0700, Jason Thorpe wrote:
> This is actually the real problem -- dhclient should not be causing the 
> interface to reset in this manner.

  At least for my machine, this is caused by /sbin/dhclient-script doing an
ifconfig ex0 inet netmask broadcast up
in the PREINIT handler.  (My laptop is not -current, but it appears
dhclient-script is still at v1.5 in -current.)

  If I do that by hand, ifconfig says the carrier goes away, and then
comes back.

  If I comment out the ifconfig in PREINIT in /sbin/dhclient-script,
my machine seems to still do the right thing.  In fact, my changes to
ifwatchd make it so that I can unplug the cable, plug it back in, and
it reruns dhclient for me precisely once (as desired), and everything
Just Works!

  I'm no networking guru.  Can anyone tell me if that ifconfig to is really necessary?  Is it only necessary if the iface is not
already up?  I can ifconfig to, unplug the cable, plug it back
in, and dhclient changes it to like it should....