I'm not sure if the child pid or the daemon pid should be checked, but maybe something like this could be added to /usr/local/etc/rc.d/kresd: kresd_status() { if [ -e "${pidfile}" ]; then echo "${name} is running on pid $(cat $pidfile)." return 1 else echo "${name} is not running." return 0 fi }
Committed, Thanks!
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=e2e231d0b5b03e64e9905b39e76ad9fd89ec765f commit e2e231d0b5b03e64e9905b39e76ad9fd89ec765f Author: Fernando Apesteguía <fernape@FreeBSD.org> AuthorDate: 2022-10-11 15:49:47 +0000 Commit: Fernando Apesteguía <fernape@FreeBSD.org> CommitDate: 2022-10-12 11:58:10 +0000 dns/knot-resolver: Fix service status Add status() function to rc script. PR: 266320 Reported by: yonas.yanfa@gmail.com Approved by: freebsd@dns.company (maintainer, timeout > 1 month) dns/knot-resolver/files/kresd.in | 10 ++++++++++ 1 file changed, 10 insertions(+)