diff options
author | 2011-04-06 17:10:38 +0000 | |
---|---|---|
committer | 2011-04-06 17:10:38 +0000 | |
commit | 849e0803bc300123afb2d2806a220073a147ef8b (patch) | |
tree | ba3029111af4f8aa8942245095aff47cb18c5ed7 | |
parent | Backout the uvm_km_getpage -> km_alloc conversion. Weird things are happening (diff) | |
download | wireguard-openbsd-849e0803bc300123afb2d2806a220073a147ef8b.tar.xz wireguard-openbsd-849e0803bc300123afb2d2806a220073a147ef8b.zip |
- 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@
-rw-r--r-- | etc/rc.d/rc.subr | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/etc/rc.d/rc.subr b/etc/rc.d/rc.subr index 386c97871ec..24a2a0c6343 100644 --- a/etc/rc.d/rc.subr +++ b/etc/rc.d/rc.subr @@ -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 |