Bug 625034
Summary: | [log-rotate] [rhel6] update of logrotate.status should be atomic | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Haim <hateya> | ||||||
Component: | logrotate | Assignee: | Jan Kaluža <jkaluza> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Tomas Dolezal <todoleza> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | low | ||||||||
Version: | 6.1 | CC: | bsettle, danken, iheim, mgoldboi, ovasik, psklenar, smeyer, yeylon | ||||||
Target Milestone: | rc | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | logrotate-3.7.8-18.el6 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2015-07-22 06:19:29 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: | |||||||||
Attachments: |
|
Description
Haim
2010-08-18 12:42:05 UTC
Only first 4096 bytes have been written to /var/lib/logrotate.status, which makes it unreadable for future lograte processes. # /usr/sbin/logrotate /etc/logrotate.d/vdsm error: line 77 too long in state file /var/lib/logrotate.status error: could not read state file, will not attempt to write into it When logrotate needs to write to logrotate.status it should probably first write to logrotate.status.tmp and move it to logrotate.status on success. Created attachment 439411 [details]
proposed patch
Attached patch fixes this bug for me. It's based on idea from Comment 2. Thanks. Not sure if this is the place for code review, but I think you should remove tmpFilename on error (which includes rename error). Yes, you're right. My first patch also didn't work well with SELinux and didn't respect permissions of old logrotate.status file. That's fixed in the newly attached patch. Created attachment 439664 [details]
proposed patch 2
This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unfortunately unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux. If you would like it considered as an exception in the current release, please ask your support representative. This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unfortunately unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux. If you would like it considered as an exception in the current release, please ask your support representative. This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate, in the next release of Red Hat Enterprise Linux. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-1293.html |