Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 42537 - Provide a logrotate sample file for Apache
Summary: Provide a logrotate sample file for Apache
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-22 19:00 UTC by Sylvain Demers
Modified: 2009-04-02 13:10 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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
}