Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 42537

Summary: Provide a logrotate sample file for Apache
Product: Gentoo Linux Reporter: Sylvain Demers <demerss>
Component: [OLD] ServerAssignee: Apache Team - Bugzilla Reports <apache-bugs>
Status: VERIFIED FIXED    
Severity: enhancement    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Sylvain Demers 2004-02-22 19:00:54 UTC
It would be nice if applications that potentially generate large log files,
such as Apache, could provide a sample logrotate file. Maybe with a USE
flag?

While logrotate files are not hard to create, sometimes the hard part
is the postrotate script.

How about this one for Apache2?

/var/log/apache2/*log {
    weekly
    rotate 4
    compress
    missingok
    notifempty
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /var/run/apache2.pid 2>/dev/null` 2> /dev/null || true
    endscript
}

Reproducible: Always
Steps to Reproduce:
Comment 1 Chuck Short (RETIRED) gentoo-dev 2004-04-02 15:30:55 UTC
Added to 2.0.49. Thanks for the bug report and suggestion.
Comment 2 Henry So, Jr. 2004-04-07 07:03:06 UTC
The sample logrotate configuration placed into the portage tree on 2-April-2004 (/var/www/www.gentoo.org/raw_cvs/gentoo-x86/net-www/apache/files/apache2,v 1.1) has errors which are picked up daily by the logrotate cron job.  Specifically, "notifempty" on line 8 is misspelled and line 10 should be preceded by "postrotate".  The following is a corrected version:

/var/log/apache2/*log {
  missingok
  notifempty
  sharedscripts
  postrotate
    /etc/init.d/apache2 reload > /dev/null 2>&1 || true
  endscript
}