RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 625034 - [log-rotate] [rhel6] update of logrotate.status should be atomic
Summary: [log-rotate] [rhel6] update of logrotate.status should be atomic
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: logrotate
Version: 6.1
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Jan Kaluža
QA Contact: Tomas Dolezal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-08-18 12:42 UTC by Haim
Modified: 2019-10-10 09:01 UTC (History)
8 users (show)

Fixed In Version: logrotate-3.7.8-18.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-22 06:19:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed patch (2.60 KB, patch)
2010-08-18 15:15 UTC, Jan Kaluža
no flags Details | Diff
proposed patch 2 (4.24 KB, patch)
2010-08-19 12:17 UTC, Jan Kaluža
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1293 0 normal SHIPPED_LIVE logrotate bug fix and enhancement update 2015-07-20 17:54:05 UTC

Description Haim 2010-08-18 12:42:05 UTC
Description of problem:

in case log rotate tries to write to log, and disk space is consumed, it writes about 4k and stops, when disk space is free, and log rotate tries to 'read' the part that it wrote, it crash, as it contain garbage.

 Aug 16 14:01:02 pele logrotate: ALERT exited abnormally with [1]
Aug 16 15:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 16 16:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 16 17:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 16 18:01:02 pele logrotate: ALERT exited abnormally with [1]
Aug 16 19:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 16 20:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 16 21:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 16 22:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 16 23:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 17 00:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 17 01:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 17 02:01:02 pele logrotate: ALERT exited abnormally with [1]
Aug 17 03:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 17 04:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 17 05:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 17 06:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 17 07:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 17 08:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 17 12:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 17 13:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 17 14:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 17 15:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 17 16:01:02 pele logrotate: ALERT exited abnormally with [1]
Aug 17 17:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 17 18:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 17 19:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 17 20:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 17 21:01:02 pele logrotate: ALERT exited abnormally with [1]
Aug 17 22:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 17 23:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 18 00:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 18 01:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 18 02:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 18 03:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 18 04:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 18 05:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 18 06:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 18 07:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 18 08:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 18 09:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 18 10:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 18 11:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 18 12:01:02 pele logrotate: ALERT exited abnormally with [1]
Aug 18 13:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 18 14:01:01 pele logrotate: ALERT exited abnormally with [1]
Aug 18 15:01:01 pele logrotate: ALERT exited abnormally with [1]

logrotate-3.7.8-12.el6.x86_64

Comment 2 Dan Kenigsberg 2010-08-18 13:29:34 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.

Comment 3 Jan Kaluža 2010-08-18 15:15:46 UTC
Created attachment 439411 [details]
proposed patch

Comment 4 Jan Kaluža 2010-08-18 15:18:54 UTC
Attached patch fixes this bug for me. It's based on idea from Comment 2.

Comment 5 Dan Kenigsberg 2010-08-18 19:15:47 UTC
Thanks. Not sure if this is the place for code review, but I think you should remove tmpFilename on error (which includes rename error).

Comment 6 Jan Kaluža 2010-08-19 12:16:50 UTC
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.

Comment 7 Jan Kaluža 2010-08-19 12:17:32 UTC
Created attachment 439664 [details]
proposed patch 2

Comment 8 RHEL Program Management 2011-01-07 15:33:20 UTC
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.

Comment 9 RHEL Program Management 2011-07-05 23:46:15 UTC
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.

Comment 11 RHEL Program Management 2013-10-14 01:17:02 UTC
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.

Comment 17 errata-xmlrpc 2015-07-22 06:19:29 UTC
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


Note You need to log in before you can comment on or make changes to this bug.