Kresd filling /tmp partition

After the last updates, my router stopped working. I could not get the web interface to respond and DNS wasn’t working either.
SSHed in to find that the error was: out of space on device.
df told me it was the tmpfs partition on /tmp
du showed me that /tmp/kresd was the culprit

In /tmp/kresd, hints.tmp was 99% of the whole partition (about 1Gb!).
I deleted it and rebooted and things were still wrong. kresd was running, but not resolving and still no web interface. Monitoring the size of hints.tmp showed it was growing fast (> 1Mb/s).
There was also a ‘cat > /tmp/kresd/hints.tmp’ process running that seemed to be feeding hints.tmp, although I couldn’t figure out what its input was. Once the cat finished, the hints.tmp was ~500Mb and mostly blank lines (at least didn’t show up on the console), with the actual hints right at the end. I replaced the hints.tmp file with just the hints after removing the 100’s of Mb of blank lines (now it’s 764bytes) and kresd is working again, as is the web interface.
If I reboot, it all goes wrong again, so it’s not fixed.
Can anyone tell me where the massive hints file is coming from? Is there a corrupted master file somewhere or am I missing something important?
Thanks for any insight.
Mike

@paja should know most about the scripts dealing with hints.tmp.

I can see cat in the code, but I can’t directly see any possible cause (except possibly escaping issues in $hostname_config but even so).

@vcunat Thanks for the pointer.
Once I trawled through that script and the various functions in it, I came to the realization that the source of the cat which fills /tmp/kresd/hints.tmp was the file referred to in option hostname_config (resolver.kresd.hostname_config to be precise).

My setting for this file (due, no doubt, to a misunderstanding of mine in the past) was /tmp/kresd/hints.tmp
Of course, this meant that the cat was taking hints.tmp as its source and putting the contents into… hints.tmp which just went round and round until /tmp filled up! One broken Omnia.

A bit more reading found several suggestions as to what hostname_config should be pointed at. The one that made most sense to me was where the static hosts definitions are kept. Namely: ‘/tmp/hosts/dhcp’
This seeds the hints file with static hosts/ips and then follows up with dhcp clients’ hostnames/ips. That gives me the result I am looking for (resolving local dynamic and static names) and doesn’t spiral out of control and fill up /tmp.
Problem solved! Hope it can help someone else who does the same stupid thing.

2 Likes