summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rcctl
diff options
context:
space:
mode:
authorajacoutot <ajacoutot@openbsd.org>2016-04-26 18:39:29 +0000
committerajacoutot <ajacoutot@openbsd.org>2016-04-26 18:39:29 +0000
commitcd46dc8c95459b411183506ef035d2bf7bdccc31 (patch)
treeafd3f75b7949a67d46b4083b2ab77d033905e08c /usr.sbin/rcctl
parentPopulate all necessary statfs members in .vfs_statfs. cd9660, udf, (diff)
downloadwireguard-openbsd-cd46dc8c95459b411183506ef035d2bf7bdccc31.tar.xz
wireguard-openbsd-cd46dc8c95459b411183506ef035d2bf7bdccc31.zip
It's ok to disable a non-existing daemon.
Think "pkg_delete foobar && rcctl disable foobar".
Diffstat (limited to 'usr.sbin/rcctl')
-rw-r--r--usr.sbin/rcctl/rcctl.sh20
1 files changed, 13 insertions, 7 deletions
diff --git a/usr.sbin/rcctl/rcctl.sh b/usr.sbin/rcctl/rcctl.sh
index 848da7188fc..9e2b17b6005 100644
--- a/usr.sbin/rcctl/rcctl.sh
+++ b/usr.sbin/rcctl/rcctl.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $OpenBSD: rcctl.sh,v 1.94 2016/04/26 17:58:42 ajacoutot Exp $
+# $OpenBSD: rcctl.sh,v 1.95 2016/04/26 18:39:29 ajacoutot Exp $
#
# Copyright (c) 2014, 2015 Antoine Jacoutot <ajacoutot@openbsd.org>
# Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -474,10 +474,13 @@ case ${action} in
shift 1
svcs="$*"
[ -z "${svcs}" ] && usage
- for svc in ${svcs}; do
- svc_is_avail ${svc} || \
- rcctl_err "service ${svc} does not exist" 2
- done
+ # it's ok to disable a non-existing daemon
+ if [ "${action}" != "disable" ]; then
+ for svc in ${svcs}; do
+ svc_is_avail ${svc} || \
+ rcctl_err "service ${svc} does not exist" 2
+ done
+ fi
;;
get|getdef)
svc=$2
@@ -503,8 +506,11 @@ case ${action} in
[ $# -ge 3 ] && shift 3 || shift $#
args="$*"
[ -z "${svc}" ] && usage
- svc_is_avail ${svc} || \
- rcctl_err "service ${svc} does not exist" 2
+ # it's ok to disable a non-existing daemon
+ if [ "${action} ${var} ${args}" != "set status off" ]; then
+ svc_is_avail ${svc} || \
+ rcctl_err "service ${svc} does not exist" 2
+ fi
[[ ${var} != @(class|flags|rtable|status|timeout|user) ]] && usage
svc_is_meta ${svc} && [ "${var}" != "status" ] && \
rcctl_err "/etc/rc.d/${svc} is a meta script, cannot \"${action} ${var}\""