Kresd init.d scipt shortcomings if location is changed

Hi, as I have an SSD in my machine and wanted to create a 1G kresd cache on it I moved the kresd configuration files to from /tmp/kresd to /mnt/ssd/kresd and changed rundir in config/resolver kresd section. I had quite some troubles to get it all working because I had two trace down to issues:

1.) hints file kept beeing /tmp/kresd.hints
2.) I started getting errors about /tmp/kresd/tty

I turned out that both problems are actually shortcomings of the /etc/init.d/kresd script. To solve the first problem I had to change the default run dir to /mnt/ssd/kresd because it was not read from config/resolver. But even after fixing this I still kept getting the /tmp/kresd/tty errors. By checking the init script I found out that this is HARDCODED!!! in the /etc/init.d/kresd script. It doesn’t even use the configured run-dir in the init script and also not config/resolver of course. In the end I changed this to be /mnt/ssd/kresd/tty too and finally everything was working until a week or so when obviously a new version of the kresd init script was installed and I was back with the old errors and had to find out a second time what’s wrong.

So please update turris configuration (in particular the /etc/init.d/kresd) to read kresd rundir from config/resolver and not from init script. And please remove tha hardcoded /tmp/kresd/tty stuff and also point it to rundir from config/resolver

1 Like

Nobody had a need to do so until now. So if you have it solved, can you send us a patch?

Actually I have no real patch because I changed the hardcoded strings at the top of /etc/init.d/kresd and hardcoded string in the script itself.

I could make a better change if I’d know how to access the rundir from config/resolver. Unfortunately I’m not familiar how to access those data otherwise I might make a patch

UPDATE: I did some reading about the UCI functions but what I’m struggling with is settings HINTS_CONFIG globally from wthin the load_uci_kresd subroutine which actually has a variable $rundir which would be suitable but I can’t manage to set $HINTS_CONFIG using $rundir. It always keeps that global value