I've added the following to /usr/local/etc/rc.d/krescachegc: start_precmd="${name}_prestart" krescachegc_prestart() { chmod 660 /var/run/kresd/*.mdb } It might be a temporary fix until /var/run/kresd/data.mdb and /var/run/kresd/lock.mdb are created with proper file permissions.
I keep these in /tmp/ as I mount it as an md(4). Which makes reading/writing the files a great deal faster. Hard-wiring these files and folder location seems like an undesirable restriction to me. Maybe make the location a variable?
(In reply to Chris Hutchinson from comment #1) How/where do you currently define the custom path? AFAIK, I think if we change chmod 660 /var/run/kresd/*.mdb to simply: chmod 660 %%RUNDIR%%/*.mdb then both of you are happy†, since rundir is already a variable in the kresd rc script - and it seems(!) the krescachegc rc script knows this. † on condition you did what the manual at knot-resolver.readthedocs.io recommend: have the entire rundir an md. OR; do you maybe happen to set yours in kresd.conf?
diff --git a/dns/knot-resolver/pkg-plist b/dns/knot-resolver/pkg-plist index bdc679d32de7..9f2f55ed0ef6 100644 --- a/dns/knot-resolver/pkg-plist +++ b/dns/knot-resolver/pkg-plist @@ -96,4 +96,4 @@ sbin/kres-cache-gc sbin/kresc sbin/kresd @dir(%%USERS%%,%%GROUPS%%,0755) %%ETCDIR%% -@dir(%%USERS%%,%%GROUPS%%,0755) %%RUNDIR%% +@dir(%%USERS%%,%%GROUPS%%,0660) %%RUNDIR%% Would this work for you?
(In reply to Chris Hutchinson from comment #1) (In reply to Fernando Apesteguía from comment #3) > Would this work for you? Yes, this works for me, thanks.
Committed, Thanks!
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=42a47e6afb86a7da4a80ff88e672116538a8a398 commit 42a47e6afb86a7da4a80ff88e672116538a8a398 Author: Fernando Apesteguía <fernape@FreeBSD.org> AuthorDate: 2022-11-09 18:09:39 +0000 Commit: Fernando Apesteguía <fernape@FreeBSD.org> CommitDate: 2022-11-10 15:44:16 +0000 dns/knot-resolver: Fix file permissions To enable cache garbage collector PR: 267016 Reported by: yonas.yanfa@gmail.com dns/knot-resolver/pkg-plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
(In reply to Leo Vandewoestijne from comment #2) FWIW I create the databases in a md(4) (memory disk/device) So as long as I'm not restricted to some specific location. I'm happy. thanks.
@Yonas / @Chris: Part of this PR is re-addressed in PR 277540