Subject: bin/23933: dhclient is gratuitously noisy
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <email@example.com>
Date: 12/30/2003 12:16:34
>Synopsis: dhclient is gratuitously noisy
>Arrival-Date: Tue Dec 30 19:20:00 UTC 2003
>Originator: Bruce J.A. Nourish
>Release: NetBSD 1.6ZG
System: NetBSD telstar.bjan.net 1.6ZG NetBSD 1.6ZG (TELSTAR) #0: Mon Dec 29 00:10:30 MST 2003 firstname.lastname@example.org:/usr/obj/sys/arch/i386/compile/TELSTAR i386
dhclient -q insists on printing stuff like:
New Network Number: 192.168.1.0
New Broadcast Address: 192.168.1.255
This makes the boot sequence output look pretty horrible. It also goes
against the man page, which says that -q should suppress all non-error
I think, however, that there are legitimate reasons for an ifconfig.int
script to generate output. If so (and assuming we agree that it is worth
making the boot output look decent), there are three obvious solutions:
(1) Put every interface on it's own line. e.g.:
Bringing up ath0:
[Hello, I'm a noisy interface.]
Bringing up bge0:
Simple, straightforward, but not particularly nice.
(2) Have a flag in the first line of an ifconfig.int script like so:
Bringing up ath0:
[Helloo, I'm a noisy interface.]
Bringing up interfaces: bge0.
Fairly simple, but rather inconsistant.
(3) Get rid of the "all on one line" method altogether:
Redirect the script output to somewhere in /tmp. Then, based on whether
the file is empty or not, and the exit status of the script, use the
[Assuming no -q flag to dhclient]
Bringing up ath0: OK.
ath0: Internet Software Consortium DHCP Client V3.0.1rc11
ath0: Copyright 1995-2002 Internet Software Consortium.
ath0: All rights reserved.
ath0: For info, please visit http://www.isc.org/products/DHCP
ath0: Listening on BPF/ath0/00:0c:41:16:a7:95
ath0: Sending on BPF/ath0/00:0c:41:16:a7:95
ath0: Sending on Socket/fallback
ath0: DHCPREQUEST on ath0 to 255.255.255.255 port 67
ath0: DHCPACK from 192.168.1.1
ath0: New Network Number: 192.168.1.0
ath0: New Broadcast Address: 192.168.1.255
ath0: bound to 192.168.1.102 -- renewal in 38415 seconds.
Bringing up bge0: OK.
Bringing up ppp0: FAILED.
ppp0: chat returned NO CARRIER
P.S.: I've just figured out how to do this without a temp file.
# dhclient -q $int
I can code up any of the above. Let me know.