From 32c195083c44525a766a9220b2c37984706a869b Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Sat, 24 Oct 2015 13:57:24 +0000 Subject: [PATCH] "enable" and "disable" are here to stay now that they have a real added value (possibility to pass several enable|disable daemons at once); so document them. While here, add a check to make sure a service|daemon exists when running "order". "Yay" and ok sthen@ --- usr.sbin/rcctl/rcctl.8 | 12 +++++++++--- usr.sbin/rcctl/rcctl.sh | 13 ++++++++----- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/usr.sbin/rcctl/rcctl.8 b/usr.sbin/rcctl/rcctl.8 index 78f6d4611cd..254d2b23712 100644 --- a/usr.sbin/rcctl/rcctl.8 +++ b/usr.sbin/rcctl/rcctl.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: rcctl.8,v 1.24 2015/10/06 18:46:05 schwarze Exp $ +.\" $OpenBSD: rcctl.8,v 1.25 2015/10/24 13:57:24 ajacoutot Exp $ .\" .\" Copyright (c) 2014 Antoine Jacoutot .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: October 6 2015 $ +.Dd $Mdocdate: October 24 2015 $ .Dt RCCTL 8 .Os .Sh NAME @@ -28,7 +28,7 @@ .Op Fl df .Ar action daemon ... .Nm rcctl -.Cm order +.Cm disable|enable|order .Op Ar daemon ... .Nm rcctl .Cm ls @@ -71,6 +71,12 @@ Run the scripts with the .Ar action argument, passing through the specified options, if any. +.It Cm disable Ar service ... | daemon ... +Alias for +.Dq Cm set Ar service | daemon Cm status off . +.It Cm enable Ar service ... | daemon ... +Alias for +.Dq Cm set Ar service | daemon Cm status on . .It Cm get Ar service | daemon Op Ar variable Display the value of .Ar service diff --git a/usr.sbin/rcctl/rcctl.sh b/usr.sbin/rcctl/rcctl.sh index 73ad2f0751d..ac86951d95b 100644 --- a/usr.sbin/rcctl/rcctl.sh +++ b/usr.sbin/rcctl/rcctl.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $OpenBSD: rcctl.sh,v 1.82 2015/10/06 18:46:05 schwarze Exp $ +# $OpenBSD: rcctl.sh,v 1.83 2015/10/24 13:57:24 ajacoutot Exp $ # # Copyright (c) 2014, 2015 Antoine Jacoutot # Copyright (c) 2014 Ingo Schwarze @@ -31,7 +31,7 @@ usage() _rc_err \ "usage: rcctl get|getdef|set service | daemon [variable [arguments]] rcctl [-df] action daemon ... - rcctl order [daemon ...] + rcctl disable|enable|order [daemon ...] rcctl ls lsarg" } @@ -437,8 +437,11 @@ case ${action} in order) shift 1 svcs="$*" + for svc in ${svcs}; do + svc_is_avail ${svc} || \ + rcctl_err "service ${svc} does not exist" 2 + done ;; - # enable|disable: undocumented, deprecated disable|enable|start|stop|restart|reload|check) shift 1 svcs="$*" @@ -486,14 +489,14 @@ case ${action} in esac case ${action} in - disable) # undocumented, deprecated + disable) needs_root ${action} for svc in ${svcs}; do svc_set ${svc} status off || ret=$?; done exit ${ret} ;; - enable) # undocumented, deprecated + enable) needs_root ${action} for svc in ${svcs}; do svc_set ${svc} status on || ret=$?; -- 2.20.1