Re: [Zinq-general] Patch to open data.cdb no more than once per second

[email protected] (Paul Jarc)
Newsgroups gmane.network.djbdns
Organization What did you have in mind? A short, blunt, human pyramid?
Message-ID <[email protected]>
Mark Johnson <[email protected]> wrote:
> I'd really prefer to have tinydns notice that data.cdb has changed and
> re-open it on it's own, but I'd take a look at any proposed SIGHUP
> solutions.

It can be done without signals.  IIRC, someone created a patch to make
tinydns keep data.cdb open, and use fstat() on it to check whether it
had been updated.  The link count would drop to zero once it had been
replaced with a new file.  That turned out not to be portable, but
something similar could work - say, if you touch the old data.cdb to
change its mtime before replacing it.  Or use the slightly more costly
stat(), and compare the device+inode+ctime, which doesn't require any
change to the procedure of updating data.cdb.


paul
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.