summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2011-07-23 22:41:45 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2011-07-23 22:41:45 +0000
commit29f7ca65cc48094d8d6c50fa9cc645ca9e6f2331 (patch)
tree61a93cea6238030a486539ba352b0470de531c9a /etc
parent67c13516c5e5c91aa0473d731803fbc1095f4b5f (diff)
Print the daemon name before starting, and ok/failed afterwards, providing
better visual cues as to what's happening. Feedback/ok aja@ schwarze@
Diffstat (limited to 'etc')
-rw-r--r--etc/rc.d/rc.subr8
1 files changed, 6 insertions, 2 deletions
diff --git a/etc/rc.d/rc.subr b/etc/rc.d/rc.subr
index 0b48f28e502..78a0beb1de3 100644
--- a/etc/rc.d/rc.subr
+++ b/etc/rc.d/rc.subr
@@ -1,4 +1,4 @@
-# $OpenBSD: rc.subr,v 1.42 2011/07/08 18:57:49 robert Exp $
+# $OpenBSD: rc.subr,v 1.43 2011/07/23 22:41:44 sthen Exp $
#
# Copyright (c) 2010, 2011 Antoine Jacoutot <ajacoutot@openbsd.org>
# Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -50,7 +50,7 @@ rc_do() {
rc_exit() {
[ -z "${INRC}" -o X"$1" != X"ok" ] && _pfix="($1)"
- echo ${INRC:+'-n'} "${INRC:+ }${_name}${_pfix}"
+ echo ${INRC:+'-n'} "${_pfix}"
[ X"$1" = X"ok" ] && exit 0 || exit 1
}
@@ -85,6 +85,7 @@ rc_cmd() {
[ X"${_enotsup}" != X"NO" ] || rc_err "$0: $1 is not supported"
[ X"${rc_bg}" = X"YES" ] && local _bg="&"
+ [ -n "${RC_DEBUG}" ] || local _n="-n"
case "$1" in
check)
@@ -92,6 +93,7 @@ rc_cmd() {
;;
start)
[ -z "${INRC}" ] && rc_do rc_check && exit 0
+ echo $_n "${INRC:+ }${_name}"
while true; do # no real loop, only needed to break
if type rc_pre >/dev/null; then
rc_do rc_pre || break
@@ -109,6 +111,7 @@ rc_cmd() {
;;
stop)
rc_do rc_check || exit 0
+ echo $_n "${INRC:+ }${_name}"
rc_do rc_stop || rc_exit failed
rc_do rc_wait stop || rc_exit failed
if type rc_post >/dev/null; then \
@@ -118,6 +121,7 @@ rc_cmd() {
;;
reload)
rc_do rc_check || exit 0
+ echo $_n "${INRC:+ }${_name}"
rc_do rc_reload || rc_exit failed
rc_do rc_check || rc_exit failed
rc_exit ok