aboutsummaryrefslogtreecommitdiff
path: root/etc/rc.subr
diff options
context:
space:
mode:
Diffstat (limited to 'etc/rc.subr')
-rw-r--r--etc/rc.subr17
1 files changed, 16 insertions, 1 deletions
diff --git a/etc/rc.subr b/etc/rc.subr
index ba3e0a4e852e..b74a0863e788 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