From 9b53ec734777c1a0d46c5b1bd21c75698b9468c4 Mon Sep 17 00:00:00 2001 From: ajacoutot <> Date: Sun, 18 Nov 2012 18:54:52 +0000 Subject: [PATCH] Don't output "$action is not supported" when running an rc.d(8) script from /etc/rc(8). This prevents the warning to be displayed at shutdown time when the script has rc_stop=NO. req. and input from fgsch@ "go ahead" schwarze@ input from an ok halex@, ok robert@ --- src/etc/rc.d/rc.subr | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/etc/rc.d/rc.subr b/src/etc/rc.d/rc.subr index 4ab9e9ee..01f7407e 100644 --- a/src/etc/rc.d/rc.subr +++ b/src/etc/rc.d/rc.subr @@ -1,4 +1,4 @@ -# $OpenBSD: rc.subr,v 1.66 2012/11/12 08:07:53 ajacoutot Exp $ +# $OpenBSD: rc.subr,v 1.67 2012/11/18 18:54:52 ajacoutot Exp $ # # Copyright (c) 2010, 2011 Antoine Jacoutot # Copyright (c) 2010, 2011 Ingo Schwarze @@ -102,7 +102,10 @@ rc_cmd() { rc_err "$0: need root privileges" eval _enotsup=\${rc_${1}} - [ X"${_enotsup}" != X"NO" ] || rc_err "$0: $1 is not supported" + if [ X"${_enotsup}" = X"NO" ]; then + [ -n "${INRC}" ] && exit 1 + rc_err "$0: $1 is not supported" + fi [ X"${rc_bg}" = X"YES" ] && _bg="&" [ -n "${_RC_DEBUG}" ] || _n="-n"