Subject: anyone successfully used 'dhclient -n -w' with omshell?
To: None <current-users@NetBSD.org>
From: Chapman Flack <nblists@anastigmatix.net>
List: current-users
Date: 06/26/2006 11:22:26
I mean, ever?
dhclient(8) hints at "The -w flag can be used to cause the
client not to exit when it doesn't find any such interfaces. The
omshell (1) program can then be used to notify the client when a net-
work interface has been added or removed," but leaves HOW to
do that to the reader's imagination.
For about three years I've occasionally thought "gee, one day I should
really sit down and figure that out, but, not today." I finally sat
down and ... didn't figure it out. And a bit of googling shows any
number of people who have reached the same point, without turning up a
single example of someone actually doing it.
AFAICT:
1. The (documented) omshell ... control ... state=<n>
for changing the global client state works as described. n=2 is
release on all managed interfaces and exit; n=3 and 4 are prepare
all managed interfaces for sleep and reconfig them after sleep,
respectively (attention ACPI folks!).
2. The (undocumented) omshell ... interface ... name=<n> ... remove
does work, and makes the client release and unmanage the specified
interface n.
3. For a new interface n that the client has not seen before, the
undocumented omshell ... interface ... name=<n> ... create
is accepted without error, and has no effect. But it cannot be
used on any interface that has been seen before (even if previously
unmanaged with remove) or is mentioned in any saved lease; the
create fails because the object already exists. In that case, you
need (the undocumented)
4. omshell ... interface ... name=<n> ... state="up" ... update
which produces the file dhclient.core. :/
I think I've found the lines in the code responsible for (3) not working,
and the rough neighborhood where the (4) problem has to be, but:
These lines are in code that's unmodified all the way back to our tree's
r1.1, so if I'm right, this functionality has simply never worked.
Or, equivalently, if anyone has been using it with success, I'm on the
wrong track.
Has anyone ever seen it work? Does Ted Lemon read this list?
-Chap