[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#334824: logrotate: Postrotate documentation - Why restart?

Just noticed this myself.  Interestingly the apache docs (which you
would hope are the definitive source of what to do say this):


By using a graceful restart, the server can be instructed to open new
log files without losing any existing or pending connections from
clients. However, in order to accomplish this, the server must
continue to write to the old log files while it finishes serving old
requests. It is therefore necessary to wait for some time after the
restart before doing any processing on the log files. A typical
scenario that simply rotates the logs and compresses the old logs to
save space is:

mv access_log access_log.old
mv error_log error_log.old
apachectl graceful
sleep 600
gzip access_log.old error_log.old 

What this doesn't say is whether apache continues serving requests
whilst a graceful restart is occuring - if you have a very busy
webserver for instance.   It seems very odd that it can't just
reopen the log files more easily :-(



Reply to: