diff options
author | dougb <dougb@FreeBSD.org> | 2009-10-16 00:17:09 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2009-10-16 00:17:09 +0000 |
commit | 9be877facbe340138d3a343176f71291978352a8 (patch) | |
tree | 69d4b84d18858b603988acdcdad8c9f21bf9a459 /etc/rc.subr | |
parent | c9a23b2b64bf0c48513317a3627620bb40af6cc8 (diff) | |
download | FreeBSD-src-9be877facbe340138d3a343176f71291978352a8.zip FreeBSD-src-9be877facbe340138d3a343176f71291978352a8.tar.gz |
MFC r197947:
In regards to the "Starting foo:" type messages at boot time, create
and employ a more generic solution, and use it in the individual rc.d
scripts that also have an $rc_quiet test:
1. Add check_startmsgs() to rc.subr.
2. In the rc.d scripts that use rc_quiet (and rc.subr) substitute
variations of [ -z "$rc_quiet" ] with check_startmsgs
3. In savecore add a trailing '.' to the end of the message to make it
more consistent with other scripts.
4. In newsyslog remove a : before the terminal '.' since we do not
expect there to be anything printed out in between to make it more
consistent.
5. In the following scripts change "quotes" to 'quotes' where no
variables exist in the message: savecore pf newsyslog
6. [Does not apply in RELENG_8]
7. In the following scripts separate the "Starting foo:" from the
terminal '.' to make them more consistent: moused hostname pf
8. In nfsclient move the message to its own line to avoid a style bug
9. In pf rc_quiet does not apply to the _stop method, so remove the
test there.
10. In motd add 'quotes' around the terminal '.' for consistency
Approved by: re (kib)
Diffstat (limited to 'etc/rc.subr')
-rw-r--r-- | etc/rc.subr | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/etc/rc.subr b/etc/rc.subr index 86e8c7d..31559fc 100644 --- a/etc/rc.subr +++ b/etc/rc.subr @@ -372,6 +372,20 @@ wait_for_pids() } # +# check_startmsgs +# If rc_quiet is set (usually as a result of using faststart at +# boot time) check if rc_startmsgs is enabled. +# +check_startmsgs() +{ + if [ -n "$rc_quiet" ]; then + checkyesno rc_startmsgs + else + return 0 + fi +} + +# # run_rc_command argument # Search for argument in the list of supported commands, which is: # "start stop restart rcvar status poll ${extra_commands}" @@ -680,13 +694,7 @@ run_rc_command() # setup the full command to run # - _show_startmsgs=1 - if [ -n "${rc_quiet}" ]; then - if ! checkyesno rc_startmsgs; then - unset _show_startmsgs - fi - fi - [ -n "$_show_startmsgs" ] && echo "Starting ${name}." + check_startmsgs && echo "Starting ${name}." if [ -n "$_chroot" ]; then _doit="\ ${_nice:+nice -n $_nice }\ |