A server running Red Hat Enterprise Linux (RHEL) 5.5 after a period of time of successful log rotation, failed to logrotate the Apache logs. The Apache logs grew into the GBs. There didn’t seem to be any apparent or logical reason for this behavior, as the log rotation scripts were identical to other comparable servers. However, a command to debug logrotate may be used to determine the cause.
This command will debug/verbose the output of logrotate without executing/running logrotate.
logrotate -d /etc/logrotate.conf
I ran the script on a server that is successfully log-rotating the Apache logs. The output was considerable, and at a quick glance did not note any errors. However, on the server, where the Apache logs were not rotating, the verbose output was short and with error. This was the result of this particular case, errors will likely vary.
reading config file /etc/logrotate.conf
including /etc/logrotate.d
reading config file acpid
reading config info for /var/log/acpid
reading config file conman
error: error accessing /var/log/conman: No such file or directory
error: conman:5 glob failed for /var/log/conman/*
The output stopped at the error. To correct this, I recreated the missing directory.
mkdir /var/log/conman
I continued to rerun the debug command to see any remaining errors. After two more runs, I recreated two more missing directories. The final run of the debug command, revealed no errors. I was particularly interested in seeing that the Apache log rotation was listed, and it was.
reading config file httpd
reading config info for /var/log/httpd/*log
The question that is now raised is how did the directories get deleted in the first place? This remains to be answered, however, I would suspect user error.
Source(s)
- Ubuntu Forums
- Web Hosting Talk