8.0 rc.d scripts less verbose?

Ian Smith smithi at nimnet.asn.au
Thu Sep 17 08:55:18 UTC 2009


On Wed, 16 Sep 2009, Doug Barton wrote:
 > Cezary Morga wrote:
 > > Dimitry Andric pisze:
 > >> Index: etc/rc.subr
 > >> ===================================================================
 > >> --- etc/rc.subr    (revision 196888)
 > >> +++ etc/rc.subr    (working copy)
 > >> @@ -680,7 +680,7 @@ run_rc_command()
 > >>  
 > >>                      # setup the full command to run
 > >>                      #
 > >> -            [ -z "${rc_quiet}" ] && echo "Starting ${name}."
 > >> +            echo "Starting ${name}."
 > >>              if [ -n "$_chroot" ]; then
 > >>                  _doit="\
 > >>  ${_nice:+nice -n $_nice }\
 > > 
 > > Wouldn't it be easier to set rc_quiet to zero-length value, like
 > > rc_quiet=""?
 > 
 > That actually would give off too much information because rc_quiet
 > suppresses error messages about scripts that don't currently have
 > _enable set to anything useful. That's arguably a bug, but it's a bug
 > that we've come to depend on.
 > 
 > The attached patch adds a knob you can set in rc.conf to see "Starting
 > foo" messages again. If people find this useful I'll be glad to commit
 > it. I'm also open to suggestions for a better name.

>From your patch:
-                       [ -z "${rc_quiet}" ] && echo "Starting ${name}."
+                       [ -z "${rc_quiet}" -o -n "${rc_starting}" ] && echo "Starting ${name}."

Presumably this variable would go in /etc/defaults/rc.conf .. seems that 
all the other rc.conf binary choices are either set "YES" or "NO" rather 
than something or empty, so perhaps more consistent with that might be:

 [ -z "${rc_quiet}" -o "${rc_starting}" = "YES" ] && echo "Starting ${name}."

As for name, not fussed, but maybe rc_startmsgs maybe more indicative?

Also, I agree with Oliver; YES should probably be the default (POLA) so 
folks annoyed by 'too much information' in console.log can disable it.

HTH, Ian


More information about the freebsd-stable mailing list