summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rcctl
diff options
context:
space:
mode:
authorajacoutot <ajacoutot@openbsd.org>2015-10-24 13:57:24 +0000
committerajacoutot <ajacoutot@openbsd.org>2015-10-24 13:57:24 +0000
commit32c195083c44525a766a9220b2c37984706a869b (patch)
tree742dbc6248f39812a8a63bb1001ed75c1ebd54af /usr.sbin/rcctl
parentDon't compile pwd_gensalt, it's not needed since we use crypt_checkpass. (diff)
downloadwireguard-openbsd-32c195083c44525a766a9220b2c37984706a869b.tar.xz
wireguard-openbsd-32c195083c44525a766a9220b2c37984706a869b.zip
"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@
Diffstat (limited to 'usr.sbin/rcctl')
-rw-r--r--usr.sbin/rcctl/rcctl.812
-rw-r--r--usr.sbin/rcctl/rcctl.sh13
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 <ajacoutot@openbsd.org>
.\"
@@ -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 <ajacoutot@openbsd.org>
# Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -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=$?;