On Wed, Aug 3, 2011 at 12:31 PM, Jarry <[email protected]> wrote:
> But is it actually necessary to do it? I mean everything between
> postrotate-endscript is done after the log file has been rotated.

The log file has been moved, but Apache still holds open the file
descriptor to the old log file--it will continue writing to that file,
even under its new name.

> So I do not understand why at that time apache must be reloaded.

The reload causes Apache to close the file descriptor, and then open
the file again. Since it *opens* the file by name, it will start with
a fresh log file.

>
> Moreover, because of that apache-reloading apc was emptied so it
> takes again some time till all php-scripts are in cache again...

What you really want is for the logrotate script to ask Apache to
flush its logs and reopen the file. I don't know offhand if Apache has
a way to do that, short of a graceful restart.

-- 
:wq

Reply via email to