Browse Source

- in case reload fails, print the failed message (from Piotr Sikora)

- (ok) is only printed while in interactive mode, but (failed) stays
even for rc if the command fails
ok ajacoutot@
OPENBSD_5_0
robert 13 years ago
parent
commit
7c823347e2
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      src/etc/rc.d/rc.subr

+ 4
- 3
src/etc/rc.d/rc.subr View File

@ -1,4 +1,4 @@
# $OpenBSD: rc.subr,v 1.33 2011/04/06 06:09:28 ajacoutot Exp $
# $OpenBSD: rc.subr,v 1.34 2011/04/06 17:10:38 robert Exp $
# Default functions and variables used by rc.d(8) scripts.
@ -33,7 +33,8 @@ rc_do() {
rc_print() {
_ret=$?
echo ${INRC:+'-n'} "${INRC:+ }${_name}($1)"
[ -z "${INRC}" -o X"$1" != X"ok" ] && _pfix="($1)"
echo ${INRC:+'-n'} "${INRC:+ }${_name}${_pfix}"
return ${_ret}
}
@ -89,7 +90,7 @@ rc_cmd() {
fi
;;
reload)
rc_do rc_check && rc_do rc_reload
rc_do rc_check && ( rc_do rc_reload || rc_print failed )
;;
restart)
/etc/rc.d/${_name} stop && /etc/rc.d/${_name} start


Loading…
Cancel
Save