summaryrefslogtreecommitdiffstats
path: root/etc/rc.d
diff options
context:
space:
mode:
authorrea <rea@FreeBSD.org>2012-01-12 06:48:11 +0000
committerrea <rea@FreeBSD.org>2012-01-12 06:48:11 +0000
commitc797a8475bbecf74b84ac55cdb264fba23feba0f (patch)
treeb397e93cc3de4ad02fadba7849f70a8974804f92 /etc/rc.d
parent240031a5631d1402bd57bc12ed8aea6a3d919a58 (diff)
downloadFreeBSD-src-c797a8475bbecf74b84ac55cdb264fba23feba0f.zip
FreeBSD-src-c797a8475bbecf74b84ac55cdb264fba23feba0f.tar.gz
rc.d: document 'quiet' prefix and fix dhclient/devd interaction
Document the current semantics of the 'quiet' command prefix in the rc.subr(8). Fix dhclient rc.d script: it should not call err() for non-DHCP-enabled interface when it is called from devd, because the latter just blindly calls 'service dhclient quietstart' on each "link up" event. Since the 'quietstart' will silence the message "Cannot 'start' <foo>. Set <foo>_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'." and running dhclient on the non-DHCP-enabled interface is the same thing as running the service <foo> without <foo>_enable set, such modification is in sync with the current semantics of the 'quiet' prefix. Approved by: glebius Reviewed by: freebsd-rc list MFC after: 2 weeks
Diffstat (limited to 'etc/rc.d')
-rwxr-xr-xetc/rc.d/dhclient9
1 files changed, 8 insertions, 1 deletions
diff --git a/etc/rc.d/dhclient b/etc/rc.d/dhclient
index adba369..d61923d 100755
--- a/etc/rc.d/dhclient
+++ b/etc/rc.d/dhclient
@@ -22,7 +22,14 @@ stop_precmd="dhclient_pre_check"
dhclient_pre_check()
{
if [ -z "${rc_force}" ] && ! dhcpif $ifn; then
- err 1 "'$ifn' is not a DHCP-enabled interface"
+ local msg
+ msg="'$ifn' is not a DHCP-enabled interface"
+ if [ -z "${rc_quiet}" ]; then
+ err 1 "$msg"
+ else
+ debug "$msg"
+ exit 1
+ fi
fi
}
OpenPOWER on IntegriCloud