On Tue, 30 April 2013 22:55:38 +0100, Paul Martin wrote: > > Parsing filenames is not feasible. The dateformat can be anything the > sysadmin specifies, and can vary from logfile to logfile. > > I'd be inclined to say that on ENOSPC on /var/lib, all bets are off. > Things will stop working (eg. dpkg). The best you can hope for is for > an automatic email to alert the sysadmin about the problem.
The issue is not that you have an unusable system _while_ you get -ENOSPC, the issue is that you have an unusable system _after_ you deleted some files or otherwise removed -ENOSPC. Worse, the system superficially appears usable and will eat your data at some inconvenient time in the future. Bugs don't come much worse than that. > Your suggested write/rename-or-fail-with-big-error is strategy is > possible, and looks to me as a less worse solution. > > Using dateext is no worse (and no better) than the default in this > case. Using file datestamps as a rotation criterion fails badly when > the system time has been set to the wrong value at some point in the > past. It would create "logfile-19700000" or something similar, which I would consider acceptable. But the next step is likely to decide that "logfile-19700000" is more than 15000 days old and therefore should be deleted. And with ntp that actually becomes a remote attack vector. Scary thought. > The alternative (and ultimately safest against log file data loss) is > to delete the status file completely if it fails writing, and hence > reset all the rotation intervals to their default. Unorthodox, yes, > confusing, yes, but absolutely the least likely to cause data loss > (except perhaps from allowing /var/log to run out of space too, which, > if /var/lib and /var/log are on the same filesystem, has already > happened). Seems good to me. Move the status file, rotate, write new status file, rename. If anything goes wrong in the middle, say a system reboot, we at least don't destroy data. Jörn -- Fantasy is more important than knowledge. Knowledge is limited, while fantasy embraces the whole world. -- Albert Einstein -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org