log files rotation

Matthew Seaman m.seaman at infracaninophile.co.uk
Tue Sep 24 21:43:23 BST 2002


On Tue, Sep 24, 2002 at 08:57:06PM +0100, Pete French wrote:
> > newsyslog(8) and /etc/newsyslog.conf is rotating the log files in
> > freebsd, may be you could use it to rotate the apache logs, i`m
> > using it actually..
> 
> Caveat: It restrats your websever - this kills any processes which might be
> running in it when the logs rotate. I found this out the hard way (database
> corruption due to incomplete writes from a CGI script when the logs rotated)

Try sending signal 30 (SIGUSR1) which will do a graceful restart of
apache:

    /var/log/httpd-access.log               644  20    100  *     Z   /var/run/httpd.pid 30
    /var/log/httpd-error.log                644  5     100  *     Z   /var/run/httpd.pid 30

Should let any pending transactions complete naturally.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
                                                      Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK




More information about the Ukfreebsd mailing list