Subject: waiting for kue(4) to become available prior to invoking dhclient
To: None <netbsd-users@netbsd.org>
From: Blair Sadewitz <blair.sadewitz@gmail.com>
List: netbsd-users
Date: 09/26/2006 10:29:16
I have a machine which uses a kue(4) adapter.  Upon a warm boot,
loading the firmware initially fails, then succeeds:

kue0 at uhub0 port 4
kue0: 3COM 3COM USB Network Interface (3C19250), rev 1.00/0.03, addr 2
kue0: cold boot, downloading firmware
kue0: Ethernet address 00:50:da:33:2f:19
kue0: at uhub0 port 4 (addr 2) disconnected
kue0 detached
kue0 at uhub0 port 4
kue0: 3COM 3COM USB Network Interface (3C19250), rev 1.00/0.03, addr 2
kue0: cold boot, downloading firmware
kue0: Ethernet address 00:50:da:33:2f:19
kue0: at uhub0 port 4 (addr 2) disconnected
kue0 detached
kue0 at uhub0 port 4
kue0: 3COM 3COM USB Network Interface (3C19250), rev 1.00/0.03, addr 2
kue0: cold boot, downloading firmware
kue0: Ethernet address 00:50:da:33:2f:19

There is enough of a delay before the interface is  attached again to
cause dhclient to bomb, as it cannot find the interface [yet].

Right now, I put ``sleep 5'' in /etc/dhclient-enter-hooks, but
sometimes that's not long enough.  Of course I could extend the time
to something that always works, but who wants to wait that
long--especially considering that sometimes I must restart dhclient
myself.

I'm wondering what the most elegant way is to fix this, besides doing
something like a loop /etc/dhclient-enter-hooks which checks a few
times for kue0 to become available.