[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Apache logs on svn.collab.net

From: Branko Čibej <brane_at_xbc.nu>
Date: 2001-10-09 22:46:52 CEST

kfogel@collab.net wrote:

>cmpilato@collab.net writes:
>
>>>It looks like logrotate hiccuped the last time it rotated the httpd logs
>>>on svn.collab.net. access_log and error_log are empty, while the
>>>..._log.1 versions seem to be current.
>>>
>>Dangit, this happened last time, too. I wonder if this is a bug in
>>Apache, or some configuration thing we have screwed up...?
>>
>
>Mike Pilato and I had a theory about this, maybe someone more familiar
>with Apache 2 can comment:
>
>`logrotate' rotates the logs at midnight on the first of each month
>(or whenever, not sure of the exact time). Now, if Apache happens to
>remain running during that rotation, and keeps its file descriptors
>open on the various logfiles, then when `logrotate' renames a file
>from `foo.log' to `foo.log.1', Apache won't ever know that the rename
>has taken place, and will just be logging in `foo.log.1' from that
>moment forward. The log file's dir entry has changed, but the
>filehandle has not. Apache would need to close and reopen the log
>file at the same time as logrotate rotates it, for things to work
>correctly. (Well, hopefully there's a better solution than that...)
>
>Can this be what's happening?
>

On my Linux box, logrotate has a "postrotate" rule to send a HUP to
Apache., and that (presumably) should cause Apache to reopen the log files.

Hmmm.... Yep, the logrotate rule on svn.collab.net is similar, *but*
there's no /var/run/httpd.pid file, which is why the HUP doesn't catch.
I wonder why ... Of course, logrotate is set up for /usr/sbin/httpd, not
the apache that's actually running. Change /etc/logrotate.d/apache to
use the right .pid file, and it should just work.

BTW, the rule on my machine runs /usr/bin/killall -HUP httpd, rather
than relying on the .pid file.

-- 
Brane �ibej   <brane_at_xbc.nu>            http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:44 2006

This is an archived mail posted to the Subversion Dev mailing list.