[OpenAFS-devel] rethinking log rotation
Michael Meffie
mmeffie@sinenomine.net
Wed, 28 Jan 2015 10:34:57 -0500
On Wed, 28 Jan 2015 07:54:56 -0500
chas williams - CONTRACTOR <chas@cmf.nrl.navy.mil> wrote:
> On Wed, 28 Jan 2015 08:37:22 +0100
> Christof Hanke <christof.hanke@rzg.mpg.de> wrote:
>
> > When you are packaging openafs, the paths are decided by the distribution, not
> > upstream.
>
> Which reminds me that OpenAFS should possibly provide a short README to
> package maintainers about what the packaging is expected to do for
> an OpenAFS install. While all the package maintainers should be on
> release-team mailing list, I don't know that they all are. Anyway, it
> seems like it might be a good idea to tell maintainers what to do if
> OpenAFS is gettting away from maintaining the packaging.
>
> > Other than that, I agree with the external rotation solution.
>
> If it was clear before I prefer external rotation since it doesn't
> duplicate work already done.
Ben, Thanks for starting this thread.
The first series of changes were originally,
3346 "do not rename log files" (abandoned)
3347 "bosserver: do not rename log file"
Later, I thought perhaps this would be less disruptive:
11600 "util: avoid overwriting log files on back to back restarts"
The idea for 3356/3347 was to get out of the log rotation business.
Instead of renaming log files on restart, we would append to the log and
reopen logs on some signal, to allow an external program do the log
rotation. (Those gerrits are bit rotted and have some poorly named new
command line options.)
Historically, the servers were restarted weekly by default, so the
server logs were renamed one a week (by default), which gave sites a
kind of log rotation. Since 1.6.x this is no longer true. The default
weekly restart time is now set to never. So for some years now, the
weekly restart does not provide this rudimentary "log rotation", and so
I think the renaming of the log files does more harm than good, given a
back to back restart destroys all the log entries.
My preference would be to remove the server log renaming entirely in
this next major revision; instead always append to existing logs when
the server processes restart, and reopen log files on a signal handler
(as is done now only for the MRAFS-style logs). This would allow for
external programs such as logrotate to handle the log rotation for sites
that are not using syslog.
The bosserver now supports an option to save the pid of the server
processes to a file. This should make it easy for sites to send the
signal to reopen the log file and get a new file handle after the server
log file was renamed by the external log rotation program.
Thanks,
Mike
--
Michael Meffie <mmeffie@sinenomine.net>