On Tue, Aug 26, 2025 at 08:36:54AM +0100, Andrew Bower wrote:
> [...]
> > Maybe it suffices to add "renamecopy" to prevent any possible problem.
>
> Yes, renamecopy looks like it solves the problem except that we could
> still lose data if wtmpdb was accessing the file and for some reason
> very slow about it - the copy might happen in an unsafe state.
>
> Ideally I think we could do with a variant on this in logrotate to
> benefit when the directories are on the same mount:
>
> renamecopyunlesssamedevice
>
> well... I'm sure the logrotate upstream maintainers would have an
> opinion on the name! :-D
Granted, if wtmpdb used /var/log/wtmp.db instead of /var/lib/wtmpdb/wtmp.db
the rest of the world would be much simpler.
The path is hardcoded in include/wtmpdb.h, although a debian patch could
override that. A symlink would do too.
I'm not sure that pushing complexity on logrotate would benefit it
or wtmpdb.
Best
g.b.