Hi,

I run my knot-resolver on a raspberry pi with pxe boot and the root file system on nfs.

I realize that this is not recommended operations.

Therefore I try to run my cache on an tmpfs file system. 

> tmpfs on /var/cache/knot-resolver type tmpfs (rw,relatime,size=102400k)

But now my knot-resolver refuses to start

Oct  2 20:14:39 pi-hole1 systemd[1]: Starting Knot Resolver daemon...
Oct  2 20:14:40 pi-hole1 kresd[1052]: [system] error while loading config: /etc/knot-resolver/kresd.conf:69: can't open cache path '/var/cache/knot-resolver'; working directory '/var/lib/knot-resolver'; No space left on device (workdir '/var/lib/knot-resolver')
Oct  2 20:14:40 pi-hole1 systemd[1]: kresd@1.service: Main process exited, code=exited, status=1/FAILURE
Oct  2 20:14:40 pi-hole1 systemd[1]: kresd@1.service: Failed with result 'exit-code'.
Oct  2 20:14:40 pi-hole1 systemd[1]: Failed to start Knot Resolver daemon.

Besides the fact that this message makes no sense (why wouldn't the cache be opened in /var/cache when /var/lib is full?), the cache gets actually opened and a database created. The kres-cache-gc process runs without problems. 

The /var/lib/knot-resolver directory exists and is writeable. 

I have tried to put it on tmpfs too, no luck.

What solved the problem was

root@pi-hole1:~# umount /var/cache/knot-resolver
root@pi-hole1:~# systemctl start kresd@1

But now the cache is on nfs. That seems risky. 

I think this is the relevant part of the configuration

-- Cache size
workdir = '/var/cache/knot-resolver'
cache.open(100 * MB, 'lmdb:///var/cache/knot-resolver') 

But it comes with a distro pre-config of

-- Set cache location
rawset(cache, 'current_storage', 'lmdb:///var/cache/knot-resolver')

Which by the way makes it very hard to change cache location. Not to mention the hard coded location in the systemd script for kres-cache-gc.

What do I do wrong?

/Ulrich