Bug 266320 - dns/knot-resolver: service status not working
Summary: dns/knot-resolver: service status not working
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Fernando Apesteguía
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-09 14:28 UTC by Yonas Yanfa
Modified: 2022-10-12 12:02 UTC (History)
2 users (show)

See Also:
fernape: maintainer-feedback? (freebsd)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yonas Yanfa 2022-09-09 14:28:23 UTC
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
}
Comment 1 Fernando Apesteguía freebsd_committer freebsd_triage 2022-10-12 12:02:11 UTC
Committed,

Thanks!
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-10-12 12:02:48 UTC
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(+)