summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2008-01-26 11:22:12 +0000
committermtm <mtm@FreeBSD.org>2008-01-26 11:22:12 +0000
commit128f4ab0d57aea53cb4339cacdfb42a764043ab6 (patch)
tree3ffc7b47836dbed4121a871b92fbc45d56084147 /etc
parent33357225906e0884a3018c3b40134a23dc26b1e4 (diff)
downloadFreeBSD-src-128f4ab0d57aea53cb4339cacdfb42a764043ab6.zip
FreeBSD-src-128f4ab0d57aea53cb4339cacdfb42a764043ab6.tar.gz
Re-implement: do not silently fail when a command is not carried
out because the rc.conf(5) variable was not enabled. Display a message that the command wasn't run and offer suggestions on what the user can do. Implement a quiet prefix, which will disable some diagnostics. The fast prefix also implies quiet. During boot we use either fast or quiet. For shutdown we already use 'faststop'. So, this informational message should only appear during interactive use. An additional benefit of having a quiet prefix is that we can start putting some of our diagnostic messages behind this knob and start "de-cluttering" the console during boot and shutdown.
Diffstat (limited to 'etc')
-rw-r--r--etc/rc2
-rw-r--r--etc/rc.d/netif2
-rw-r--r--etc/rc.subr17
3 files changed, 18 insertions, 3 deletions
diff --git a/etc/rc b/etc/rc
index 144e3c9..2e63965 100644
--- a/etc/rc
+++ b/etc/rc
@@ -56,7 +56,7 @@ if [ "$1" = autoboot ]; then
rc_fast=yes # run_rc_command(): do fast booting
else
autoboot=no
- _boot="start"
+ _boot="quietstart"
fi
dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null`
diff --git a/etc/rc.d/netif b/etc/rc.d/netif
index c2ac711..78cca61 100644
--- a/etc/rc.d/netif
+++ b/etc/rc.d/netif
@@ -72,7 +72,7 @@ network_start()
if [ -f /etc/rc.d/ipfilter ] ; then
# Resync ipfilter
- /etc/rc.d/ipfilter resync
+ /etc/rc.d/ipfilter quietresync
fi
if [ -f /etc/rc.d/bridge -a -n "$cmdifn" ] ; then
/etc/rc.d/bridge start $cmdifn
diff --git a/etc/rc.subr b/etc/rc.subr
index ba3e0a4..b74a086 100644
--- a/etc/rc.subr
+++ b/etc/rc.subr
@@ -377,9 +377,10 @@ wait_for_pids()
# If argument has a given prefix, then change the operation as follows:
# Prefix Operation
# ------ ---------
-# fast Skip the pid check, and set rc_fast=yes
+# fast Skip the pid check, and set rc_fast=yes, rc_quiet=yes
# force Set ${rcvar} to YES, and set rc_force=yes
# one Set ${rcvar} to YES
+# quiet Don't output some diagnostics, and set rc_quiet=yes
#
# The following globals are used:
#
@@ -522,6 +523,8 @@ wait_for_pids()
#
# rc_force Not empty if "force" was provided (q.v.)
#
+# rc_quiet Not empty if "quiet" was provided
+#
#
run_rc_command()
{
@@ -542,6 +545,7 @@ run_rc_command()
fast*) # "fast" prefix; don't check pid
rc_arg=${rc_arg#fast}
rc_fast=yes
+ rc_quiet=yes
;;
force*) # "force prefix; always run
rc_force=yes
@@ -558,6 +562,11 @@ run_rc_command()
eval ${rcvar}=YES
fi
;;
+ quiet*) # "quiet" prefix; omit some messages
+ _rc_prefix=quiet
+ rc_arg=${rc_arg#${_rc_prefix}}
+ rc_quiet=yes
+ ;;
esac
eval _override_command=\$${name}_program
@@ -606,6 +615,12 @@ run_rc_command()
#
if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" ]; then
if ! checkyesno ${rcvar}; then
+ if [ -n "${rc_quiet}" ]; then
+ return 0
+ fi
+ echo -n "Cannot '${rc_arg}' $name. Set ${rcvar} to "
+ echo -n "YES in /etc/rc.conf or use 'one${rc_arg}' "
+ echo "instead of '${rc_arg}'."
return 0
fi
fi
OpenPOWER on IntegriCloud