Subject: bin/23933: dhclient is gratuitously noisy
To: None <>
From: None <>
List: netbsd-bugs
Date: 12/30/2003 12:16:34
>Number:         23933
>Category:       bin
>Synopsis:       dhclient is gratuitously noisy
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 30 19:20:00 UTC 2003
>Originator:     Bruce J.A. Nourish
>Release:        NetBSD 1.6ZG
System: NetBSD 1.6ZG NetBSD 1.6ZG (TELSTAR) #0: Mon Dec 29 00:10:30 MST 2003 i386
Architecture: i386
Machine: i386
dhclient -q insists on printing stuff like:

New Network Number:
New Broadcast Address:

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
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 script like so:

dhclient $int


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 
appropriate format: 

[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
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 port 67
ath0: DHCPACK from
ath0: New Network Number:
ath0: New Broadcast Address:
ath0: bound to -- 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.