Bug 447022
Summary: | Logrotate doesn't rotate logs if /var/lib/logrotate.status is corrupted | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Filipe Brandenburger <filbranden> | |
Component: | logrotate | Assignee: | Tomas Smetana <tsmetana> | |
Status: | CLOSED ERRATA | QA Contact: | ||
Severity: | medium | Docs Contact: | ||
Priority: | low | |||
Version: | 5.1 | CC: | ajb, kdudka, mkoci, mmalik, rbiba, richlv, rvokal, syeghiay | |
Target Milestone: | rc | |||
Target Release: | --- | |||
Hardware: | All | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Bug Fix | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 483734 1321980 (view as bug list) | Environment: | ||
Last Closed: | 2008-09-17 17:27:37 UTC | Type: | --- | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | 1321980 | |||
Bug Blocks: | 483734 |
Description
Filipe Brandenburger
2008-05-17 00:45:53 UTC
The status file is not supposed to be edited by the user and any corruption in it is considered to be a serious error. I can't imagine a situation when this could be solved without a manual intervention that should involve also re-running logrotate. Agreed. However, the default action of logrotate, which is "stop rotating all logs" when the file gets corrupted, does not help at all. It would be more helpful to discard the contents of the file, force the logs to rotate (it's the safest thing to do) and recreate the file from that point. That would allow the problem to be fixed (the only way it can be fixed really) without an administrator intervention. Otherwise, it's more administrative job. Not to mention that if the admin is not watching closely, this is a time bomb ready to blow at any time. In some machines, if the logs stop rotating, they can easily fill the disk of the machine in a few hours. You're right that stopping to rotate the files is probably not the best idea -- issuing an error should be enough. However I'm afraid to touch a file that got magically corrupted -- it may cause even more damage. I'll try to change the behaviour in case of status file error in the upstream version and then backport to RHEL. Same error on my side, i performed a rm -rf /var/lib/logrotate.status, then a logrotate -f /etc/logrotate.d/syslog. /var/lib/logrotate.status has been created after this and logrotate work correctly now. This request was evaluated by Red Hat Product Management for inclusion, but this component is not scheduled to be updated in the current Red Hat Enterprise Linux release. If you would like this request to be reviewed for the next minor release, ask your support representative to set the next rhel-x.y flag to "?". An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2008-0881.html (In reply to Tomas Smetana from comment #3) > I'll try to change the behaviour in case of status file error in the upstream > version and then backport to RHEL. For your information, the upstream commit has been reverted: https://github.com/logrotate/logrotate/commit/r3-8-5~20 ... which caused a regression in RHEL-7: bug #1321980 The referenced bug #1321980 is not accessible - can it please be made available? (In reply to richlv from comment #14) > The referenced bug #1321980 is not accessible There is nothing really interesting on the mentioned bug. You can follow progress on a similar RHEL-7 bug here: bug #1374550 There is also an upstream patch to implement recovery from a corrupted state file but there is no plan to backport it to RHEL-7 yet: https://github.com/logrotate/logrotate/commit/b9d82003 |