diff options
author | mtm <mtm@FreeBSD.org> | 2008-06-23 05:09:09 +0000 |
---|---|---|
committer | mtm <mtm@FreeBSD.org> | 2008-06-23 05:09:09 +0000 |
commit | 88c4783a40954d6c191083f0147479775667be73 (patch) | |
tree | 7f16a232233bdb1edb6988537cea940abec7e675 /etc | |
parent | a12ffbbd8b36c6672bd6c89e5a538d2678caa9aa (diff) | |
download | FreeBSD-src-88c4783a40954d6c191083f0147479775667be73.zip FreeBSD-src-88c4783a40954d6c191083f0147479775667be73.tar.gz |
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.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/rc.subr | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/etc/rc.subr b/etc/rc.subr index 15377b0..724bc6a 100644 --- a/etc/rc.subr +++ b/etc/rc.subr @@ -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 # |