summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2021-10-23 08:19:28 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2021-10-23 08:19:28 +0000
commit6fa156d79a1e2c343eea0ddfccbdf736a95a3385 (patch)
treecef707ff177827d2c56b32a4dff270d6e353bca4 /usr.sbin
parentfa2dec1268457d1da65ccd771767095d97f8ac70 (diff)
add "rcctl ls rogue", to show daemons which are running but not set as
"enabled" in rc.conf.local. naming suggesting from schwarze@, ok kn@ ajacoutot@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/rcctl/rcctl.88
-rw-r--r--usr.sbin/rcctl/rcctl.sh13
2 files changed, 15 insertions, 6 deletions
diff --git a/usr.sbin/rcctl/rcctl.8 b/usr.sbin/rcctl/rcctl.8
index b84ea04a479..6c3048b834c 100644
--- a/usr.sbin/rcctl/rcctl.8
+++ b/usr.sbin/rcctl/rcctl.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: rcctl.8,v 1.37 2021/06/26 18:02:48 jmc Exp $
+.\" $OpenBSD: rcctl.8,v 1.38 2021/10/23 08:19:27 sthen 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: June 26 2021 $
+.Dd $Mdocdate: October 23 2021 $
.Dt RCCTL 8
.Os
.Sh NAME
@@ -36,7 +36,7 @@
.Nm rcctl
.Cm ls
.Sm off
-.Cm all | failed | on | off | started | stopped
+.Cm all | failed | on | off | rogue | started | stopped
.Sm on
.Sh DESCRIPTION
The
@@ -123,6 +123,8 @@ enabled but stopped daemons
disabled services and daemons
.It Cm on
enabled services and daemons
+.It Cm rogue
+daemons which are disabled but currently running
.It Cm started
running daemons
.It Cm stopped
diff --git a/usr.sbin/rcctl/rcctl.sh b/usr.sbin/rcctl/rcctl.sh
index 699737ff6cc..ec1e478fad1 100644
--- a/usr.sbin/rcctl/rcctl.sh
+++ b/usr.sbin/rcctl/rcctl.sh
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# $OpenBSD: rcctl.sh,v 1.110 2021/02/27 09:28:04 ajacoutot Exp $
+# $OpenBSD: rcctl.sh,v 1.111 2021/10/23 08:19:27 sthen Exp $
#
# Copyright (c) 2014, 2015-2021 Antoine Jacoutot <ajacoutot@openbsd.org>
# Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -35,7 +35,7 @@ usage()
"usage: rcctl get|getdef|set service | daemon [variable [arguments]]
rcctl [-df] ${_a} daemon ...
rcctl disable|enable|order [daemon ...]
- rcctl ls all|failed|off|on|started|stopped"
+ rcctl ls all|failed|off|on|rogue|started|stopped"
}
needs_root()
@@ -228,6 +228,13 @@ svc_ls()
unset _on
done
;;
+ rogue)
+ for _svc in $(svc_ls off); do
+ ! svc_is_special ${_svc} && \
+ /etc/rc.d/${_svc} check >/dev/null && \
+ echo ${_svc} && _ret=1
+ done
+ ;;
started|stopped)
for _svc in $(ls_rcscripts); do
/etc/rc.d/${_svc} check >/dev/null && _started=1
@@ -502,7 +509,7 @@ ret=0
case ${action} in
ls)
lsarg=$2
- [[ ${lsarg} == @(all|failed|off|on|started|stopped) ]] || usage
+ [[ ${lsarg} == @(all|failed|off|on|rogue|started|stopped) ]] || usage
;;
order)
shift 1