Project

General

Profile

Actions

Bug #4011

closed

The logrotate configuration in RHEL does not rotate httpd logs

Added by Matthieu CERDA over 10 years ago. Updated over 10 years ago.

Status:
Released
Priority:
2
Category:
System techniques
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

The logrotate configuration in RHEL does not rotate httpd logs, because it uses:
  • A wrong directory (/var/log/rudder/apache2 instead of /var/log/rudder/httpd)
  • A wrong postrotate command (/etc/init.d/apache2 reload instead of /etc/init.d/httpd reload)
/var/log/rudder/apache2/*.log {
        daily
        missingok
        rotate 30
        compress
        notifempty
        create 640 root root
        delaycompress
        sharedscripts
        postrotate
          /etc/init.d/apache2 reload > /dev/null
        endscript
}
To fix the problem, we will have to:
  • Fix the command
  • Fix the directory, but cf. #4010, we will now use /var/log/rudder/apache2 directory for apache logging on all OSes from 2.8 onwards. Therefore, we need to add a second logrotate entry for /var/log/rudder/apache2 as well as /var/log/rudder/httpd.

The result should be:

# Pre-2.8 rotation for Apache
# Before the unification of the apache log directories (http://www.rudder-project.org/redmine/issues/4010)
# we used this directory to store apache logs.
/var/log/rudder/httpd/*.log {
        daily
        missingok
        rotate 30
        compress
        notifempty
        create 640 root root
        delaycompress
        sharedscripts
        postrotate
          /etc/init.d/httpd reload > /dev/null
        endscript
}

/var/log/rudder/apache2/*.log {
        daily
        missingok
        rotate 30
        compress
        notifempty
        create 640 root root
        delaycompress
        sharedscripts
        postrotate
          /etc/init.d/httpd reload > /dev/null
        endscript
}

Actions

Also available in: Atom PDF