summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorajacoutot <ajacoutot@openbsd.org>2012-09-01 07:08:37 +0000
committerajacoutot <ajacoutot@openbsd.org>2012-09-01 07:08:37 +0000
commit0f1bbbaec6d7190151b011674670e932e47f2648 (patch)
tree6668d3c306239cd577576c89990948af64b26fab
parentClean up the correct file to fix parallel make failures (diff)
downloadwireguard-openbsd-0f1bbbaec6d7190151b011674670e932e47f2648.tar.xz
wireguard-openbsd-0f1bbbaec6d7190151b011674670e932e47f2648.zip
Make '-f' only affects the "start" action.
There is no reason we couldn't reload|stop a daemon even when _flags is set to NO. As a bonus side effect, we can now see usage() on disabled scripts. discussed with sthen@ and espie@ ok sthen@
-rw-r--r--etc/rc.d/rc.subr15
-rw-r--r--share/man/man8/rc.d.813
2 files changed, 14 insertions, 14 deletions
diff --git a/etc/rc.d/rc.subr b/etc/rc.d/rc.subr
index ad89293b07f..85f34d83420 100644
--- a/etc/rc.d/rc.subr
+++ b/etc/rc.d/rc.subr
@@ -1,4 +1,4 @@
-# $OpenBSD: rc.subr,v 1.63 2012/08/21 06:38:52 ajacoutot Exp $
+# $OpenBSD: rc.subr,v 1.64 2012/09/01 07:08:37 ajacoutot Exp $
#
# Copyright (c) 2010, 2011 Antoine Jacoutot <ajacoutot@openbsd.org>
# Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -101,15 +101,6 @@ rc_cmd() {
[ X"${rc_usercheck}" != X"NO" -a X"$1" = "Xcheck" ] || \
rc_err "$0: need root privileges"
- 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"
@@ -123,6 +114,10 @@ rc_cmd() {
rc_do rc_check
;;
start)
+ if [ X"${daemon_flags}" = X"NO" ]; then
+ rc_err "$0: no $1 without -f, ${_name}_flags=NO"
+ exit 1
+ fi
[ -z "${INRC}" ] && rc_do rc_check && exit 0
echo $_n "${INRC:+ }${_name}"
while true; do # no real loop, only needed to break
diff --git a/share/man/man8/rc.d.8 b/share/man/man8/rc.d.8
index 79e45285e13..ddb95c24ef3 100644
--- a/share/man/man8/rc.d.8
+++ b/share/man/man8/rc.d.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: rc.d.8,v 1.21 2012/02/22 10:38:24 ajacoutot Exp $
+.\" $OpenBSD: rc.d.8,v 1.22 2012/09/01 07:08:37 ajacoutot Exp $
.\"
.\" Copyright (c) 2011 Robert Nagy, Antoine Jacoutot, Ingo Schwarze
.\" All rights reserved.
@@ -24,7 +24,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: February 22 2012 $
+.Dd $Mdocdate: September 1 2012 $
.Dt RC.D 8
.Os
.Sh NAME
@@ -63,9 +63,14 @@ framework from redirecting stdin and stderr to /dev/null.
This is used to allow debugging of failed
.Ar actions .
.It Fl f
-Setting this option will force operations with the given action.
+This option only affects the
+.Cm start
+action.
+It will forcibly start the daemon whatever value
+.Va daemon_flags
+is set to.
If
-.Ar daemon Ns _flags
+.Va daemon_flags
is set to
.Dq NO ,
execution will continue with the script's own defaults unless other