Resolver restart ending in a crash loop after introducing change in custom.conf

opkg list-installed | grep knot-resolver:
knot-resolver - 5.7.4-1

HBS 7.0.2

After service resolver restart the kresd not starting anymore.

/etc/kresd# service resolver restart
Called /etc/init.d/kresd stop
remove dhcp script
job 11 at Wed Sep 18 12:34:00 2024
Called /etc/init.d/kresd start
remove dhcp script

the socat - /tmp/kresd/control/* wont’ respond at all - jumping back for next input.

Same info printed if the init.d called directly > /etc/init.d/resolver restart

For next restart did some change in ‘/etc/kresd/custom.conf’ to see if it does anything in reality, and it does, from 20.0M default to 40.0M requested:

ls -lh /tmp/kresd/data.mdb
-rw-r----- 1 kresd kresd 40.0M Sep 18 12:56 /tmp/kresd/data.mdb

dig 1.1.1.1
;; communications error to 127.0.0.1#53: connection refused
; <<>> DiG 9.18.24 <<>> 1.1.1.1
;; global options: +cmd
;; no servers could be reached

Can’t continue browsing with any page already loaded - interestingly, except forum.turris.cz - this site is working.

Just playing around with it to learn more about caching.

listing service status:

/etc/init.d/resolver          	   enabled	   stopped
/etc/init.d/kresd             	  disabled	   stopped

After reboot, this inability to connect with socat remain, now with some info returned:

socat[9599] E open("/tmp/kresd/control/*", 0102, 0666): No such file or directory

The logread | grep 'kresd':

Instance kresd::instance1 s in a crash loop 6 crashes, 0 seconds since last crash

In etc/config/resolver:

section config resolver ‘kresd’ - option include_config ‘/etc/kresd/custom.conf’

and the appropriate file exist (otherwise no change in data.mbd).

All changes, except conf file and pointing to it, is adding:

cache.open(40*MB)
cache.size(100*MB)

and that is all.

After path added into resolver, it does exist in /tmp/kresd.config (in this case not yet any configurations existing)

--- Included custom configuration file from: ---
--- /etc/kresd/custom.conf
user('kresd','kresd')

Wondering why this simple change does cause kresd not resolving anymore after restart.

Had to rollback back few hrs - schnapps rollback X / reboot, this does help.

The logread only return me some info, the /var/log/ does not contain anything regarding kresd, and as can’t use socat after service restart it’s dead end for me.

Even uninstall the ujail&seccomp as thinking it could interfere with this.

No change.

What is my mistake here, where look for more info?

Did you add user and group kresd into the system? Are respective paths accessible to that user? Why even change this?

groupadd: user/group ‘kresd’ already exists

As ls -l /etc - is all root (except one mosquitt usr) I didn’t bother to change it.

Mainly because the values were loaded each time into /tmp/kresd.conf so I didn’t think about that much.

But did that root@turris:/etc/kresd# chown kresd:kresd /etc/kresd/custom.conf

-rw-r--r--

If again adding the 2 lines in it:

cache.open(40*MB)
cache.size(100*MB)

they appear in vi /tmp/kresd.config after resolver restart

--- Included custom configuration file from: ---
--- /etc/kresd/custom.conf
cache.open(40*MB)
cache.size(100*MB)
user('kresd','kresd')

And until remaining in custom.conf - resolver not resolving.

If deleted, it starts again.


My goal is to have the resolving done locally (for all LAN devices avoiding unnecessary forwarding after first successful entry for IP:domain is stored) as much as possible.

As reading this today it’s by default one day max - as per cache.max_ttl am I right?

So for max few dozen devices connected (yes, it depends how much requests they generating) it should be all right by default(?) anyway as Sizing info provides ‘size around 100 MB is more than enough’ and ‘cache.size: is only a hint to the backend, which may or may not respect it.’

Don’t care much about speed unless it’s stuck for hundreds ms.

This is an invalid line.

2 Likes

Thank you for pointing this out, you’re right.

cache.size = 100 * MB it is, should double check manual.

Now it’s working after service restart (socat does not until reboot).

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.