diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2012-05-30 08:19:15 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2012-05-30 08:19:15 +0000 |
commit | f78d5efdd40e76a5d4c6765ebc5f4c224d5d16e4 (patch) | |
tree | 1d71dd3e0845528b23d2ee0362978b7255fc76ad /etc/rc.d | |
parent | a426e60fca3615397b85fe56bcc930ba22c1d8d0 (diff) |
in -d mode, display an error message before exiting, in the case the
daemon is not active (happens often to me, as I forget which box has
which daemons).
okay ajacoutot@
Diffstat (limited to 'etc/rc.d')
-rw-r--r-- | etc/rc.d/rc.subr | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/etc/rc.d/rc.subr b/etc/rc.d/rc.subr index ab118ae8953..11f2be35249 100644 --- a/etc/rc.d/rc.subr +++ b/etc/rc.d/rc.subr @@ -1,4 +1,4 @@ -# $OpenBSD: rc.subr,v 1.56 2011/11/30 08:06:02 ajacoutot Exp $ +# $OpenBSD: rc.subr,v 1.57 2012/05/30 08:19:14 espie Exp $ # # Copyright (c) 2010, 2011 Antoine Jacoutot <ajacoutot@openbsd.org> # Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -97,7 +97,14 @@ rc_wait() { rc_cmd() { local _bg _n - [ -z "${_RC_FORCE}" ] && [ X"${daemon_flags}" = X"NO" ] && exit 1 + if [ -z "${_RC_FORCE}" ] && [ X"${daemon_flags}" = X"NO" ] + then + if [ -n "${_RC_DEBUG}" ] + then + rc_err "$0: no $1 without -f, ${_name}_flags=NO" + fi + exit 1 + fi eval _enotsup=\${rc_${1}} [ X"${_enotsup}" != X"NO" ] || rc_err "$0: $1 is not supported" |