Bug 604073 - log deleted after "gzip: stdin: Input/output error"
Summary: log deleted after "gzip: stdin: Input/output error"
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: logrotate
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Jan Kaluža
QA Contact: Alex Sersen
Depends On: 567365
TreeView+ depends on / blocked
Reported: 2010-06-15 11:16 UTC by Jan Kaluža
Modified: 2013-11-01 01:33 UTC (History)
7 users (show)

Clone Of: 567365
Last Closed: 2010-11-10 21:06:24 UTC

Attachments (Terms of Use)
proposed patch (453 bytes, patch)
2010-06-15 11:26 UTC, Jan Kaluža
no flags Details | Diff
proposed patch 2 (375 bytes, patch)
2010-06-24 12:54 UTC, Jan Kaluža
no flags Details | Diff

Description Jan Kaluža 2010-06-15 11:16:02 UTC
+++ This bug was initially created as a clone of Bug #567365 +++

Description of problem:
Our logs for httpd are stored on NFS. After some temporary problem with NFS (not known yet) the logrotate was not able to compress one of the logs and removed it. I would suggest if logrotate receives some error from gzip it shouldn't remove original file and should keep it untouched. Some very important logs might be lost. 

This was sent by email: 

gzip: stdin: Input/output error 
error: unable to open /mnt/*****/logs/access.log.1 for compression

The config for rotation of these logs is following 

    rotate 730
    create 644 root root
        /sbin/service httpd reload > /dev/null 2>/dev/null || true

Version-Release number of selected component (if applicable):

Comment 2 Jan Kaluža 2010-06-15 11:26:39 UTC
Created attachment 424120 [details]
proposed patch

This patch fixes described bug.

Comment 3 RHEL Product and Program Management 2010-06-15 11:33:15 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for

Comment 4 Jan Kaluža 2010-06-15 13:37:10 UTC
Committed in CVS, fixed in logrotate-3_7_8-9_el6.


Comment 7 Jan Kaluža 2010-06-24 12:54:19 UTC
Created attachment 426558 [details]
proposed patch 2

Unfortunately, previous patch fixed only one possible problem. This patch fixes the second reason of this bug.

In my opinion, there is problem in renaming "log" to "log.1" when "rename"
function returns error code. In that case we shouldn't continue with rotation
process for that particular log, because "log.1" doesn't have to be created and
in next step we overwrite "log" (so it's lost).

The gzip error is showed only as result of non existing "log.1" file. After
applying this patch, rotation is stopped before the compress code.

Comment 8 Jan Kaluža 2010-06-24 13:02:19 UTC
Committed in CVS, fixed in logrotate-3.7.8-12.el6.


Comment 11 releng-rhel@redhat.com 2010-11-10 21:06:24 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

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