Re: Logrotate in CentOS 5.4 more brutal (to httpd at least) than in 5.3?

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



Matthew Miller wrote:

> That said, *both* of them are too brutal, in that they'll kill any open
> connections. Signal USR1 (or service httpd graceful) is much nicer, since it
> lets any open connections complete. The downside is that these old
> connections might get written to the _rotated_ log instead of the new one,
> but to me that's a small price to pay.

I've always used copytruncate for httpd logs and logrotate, never
bothered to send signals to apache at all...

sample config -

"/path/to/logs/*www*log" {
        daily
        rotate 1
        nocompress
        notifempty
        copytruncate
        missingok
        sharedscripts

        olddir /path/to/archivedir

        postrotate
                DATE=`date --date=Yesterday +%y%m%d`
                cd /path/to/archivedir
                for FOO in `ls *.1`
                do
                        mv $FOO `echo $FOO | cut -f1 -d.`.$DATE.log
                done
                gzip -9 *.$DATE.log
                sleep 60
                sync
                logger "[LOGROTATE] Rotated these logs: `echo
*.${DATE}.log.gz`"
        endscript

}


nate

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux