Move the diagnostic output when the rc.subr(8) glue automatically starts a

service behind $rc_quiet. Instead, output a warning if the pre-command
routine or the command itself failed. Arguably, it's more useful to know when
a command failed to start than it is to have an endless list of
"Starting ...." lines[1].

[1] - This change actually helped me to discover a bug in rc.d/{lockd,statd}
      (fixed in r179941) that used to fail silently before.
This commit is contained in:
Mike Makonnen 2008-06-23 05:09:09 +00:00
parent 94789e5ca4
commit d7c5bf81cb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179946

View File

@ -673,11 +673,14 @@ run_rc_command()
return 1
fi
_run_rc_precmd || return 1
if ! _run_rc_precmd; then
warn "failed precmd routine for ${name}"
return 1
fi
# setup the full command to run
#
echo "Starting ${name}."
[ -z "${rc_quiet}" ] && echo "Starting ${name}."
if [ -n "$_chroot" ]; then
_doit="\
${_nice:+nice -n $_nice }\
@ -700,7 +703,10 @@ $command $rc_flags $command_args"
# run the full command
#
_run_rc_doit "$_doit" || return 1
if ! _run_rc_doit "$_doit"; then
warn "failed to start ${name}"
return 1
fi
# finally, run postcmd
#