Proposal: keep / preserve kresd dns cache after restart (via config option)


today in /etc/init.d/kresd is hardcoded …

set_param_func "cache.clear" ""

… so every restart resets the dns cache as well. This is quite annoying with adblock in place, where every blocklist refresh leads into a kresd restart / cache reset …

Proposal: add this small piece of code to /etc/init.d/kresd and make it configurable via “msg_keep_cache”. The variable defaults to “0” (clear cache), however now it’s possible to control/change the cache behaviour.

config_get msg_keep_cache “$section” msg_keep_cache 0
[ “$msg_keep_cache” -eq 0 ] && set_param_func “cache.clear” “”


1 Like

/cc @paja. From kresd upstream point of view, starting with 1.3.x there should no longer appear problems with DNS that were possible to work around by clearing the cache. There might still be other motivation to “start from a clear state” by default, but restarting the process is the easiest way to “reload configuration”, due to configuration being just a lua script that can (potentially) alter daemon’s internal state in any way…

@paja @cynerd

Any chance to get this small+useful change in turris upstream?

1 Like

With such suggestions you would have better chance on our gitlab specially if you also provide patch. You can create issue for it here:

Anyway I don’t know anything about that init script so @paja is the one to contact. I will ping him.

Many thanks!
For unknown reason I can’t fork the gitlab repo and therefore can’t send a Merge/Pull request. Anyway I’ve opened an issue here

best regards!

Most probably we have it set to not allow external people to create their own repositories (we are not git hosting after all). Until now everyone just submitted patches (git format-patch) so that is the way I would suggest.

I think this can be closed, as this is AFAIK implemented on latest stable TurrisOS version.

1 Like