Stuart Henderson, 2021-10-21 16:45:47 +0100:
> Sometimes I find it useful to list daemons which are set to 'disabled'
> but are actually running. Either those where I have started them by hand
> forgotten to enable in rc.conf.local, or to check for services which
> shouldn't be running but which are anyway. Any comments on this diff
> to add it to rcctl? It's pretty much the opposite of "rcctl ls failed".

An alternative solution to the problem: report an abnormal daemon status
in a new field of existing commands' output. For example, given daemons:

        dhcpd  is  off and stop
        cron       on  and run
        ftpd       off but run   (rogue)
        smtpd      on  but stop  (failed)

new output may look this:

        # rcctl ls off
        dhcpd
        ftpd    running          # aka rogue

        # rcctl ls started
        cron
        ftpd    off              # aka rogue

For parity:

        # rcctl ls stopped
        dhcpd
        smtpd   on               # aka failed

        # rcctl ls on
        cron
        smtpd   stopped          # aka failed

and, perhaps, even:

        # rcctl ls all
        dhcpd   off     stopped
        cron    on      running
        ftpd    off     running
        smtpd   on      stopped

Rationale: avoid coming up with command names for needed permutations of
statuses; less commands; full status overview (for 'rcctl ls all').

Drawback: breaks potential programmes that read and parse the output of
'rcctl ls'. Can be mitigated by guarding new output with some -s(tatus)
or -v(erbose) command line flag.

Thoughts?

Reply via email to