`keactrl status` exits 0 even if services that are configured to be running are not
Describe the bug
On systems without systemd (like FreeBSD), keactrl
is used to manage the various Kea services.
It is also used by FreeBSDs service
command to check the status of the service: https://github.com/freebsd/freebsd-ports/blob/e4facd44fc5c11652e3dc30cf131535d2761fda1/net/kea/files/kea.in#L28
However, keactrl
always returns 0
and thus service kea status
and service kea onestatus
do not report non-running Kaa services in a machine-usable way.
This breaks e.g. the Ansible service
module that expects service <name> onestatus
to return 1
when things are not running: https://github.com/ansible/ansible/blob/293bba7533e3408ce7807b16b735057532d805e2/lib/ansible/modules/service.py#L1014-L1022
To Reproduce Steps to reproduce the behavior:
- Configure Kea (dhcp4) on FreeBSD 14 (
/usr/local/etc/kea/keactrl.conf
,dhcp4=yes
) - Do not start it
- Run
keactrl status
Expected behavior
$?
is 1
Environment:
- Kea version: 2.6.0 from FreeBSD ports
- OS: FreeBSD 14 amd64
Contacting you Here is fine :-)