Bug 567365

Summary: log deleted after "gzip: stdin: Input/output error"
Product: Red Hat Enterprise Linux 5 Reporter: Dmytro Lisnichenko <dlisnich>
Component: logrotateAssignee: Jan Kaluža <jkaluza>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: high Docs Contact:
Priority: low    
Version: 5.3CC: asersen, azelinka, dlisnich, mmatsuya, mschick, ovasik, rbiba, tsmetana
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: logrotate-3.7.4-12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 604073 (view as bug list) Environment:
Last Closed: 2011-05-18 14:57:19 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:    
Bug Blocks: 604073    
Attachments:
Description Flags
proposed patch
none
prosode patch none

Description Dmytro Lisnichenko 2010-02-22 18:38:57 UTC
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 

{
    daily
    missingok
    rotate 730
    compress
    delaycompress
    create 644 root root
    notifempty
    sharedscripts
    postrotate
        /sbin/service httpd reload > /dev/null 2>/dev/null || true
    endscript
}

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

Comment 1 Jan Kaluža 2010-06-15 11:28:06 UTC
Created attachment 424122 [details]
proposed patch

This patch fixes described bug.

Comment 2 Jan Kaluža 2010-06-24 12:21:20 UTC
Created attachment 426548 [details]
prosode patch

I think this patch fixes this bug for RHEL5 (unfortunately, previous one fixed the problem only for RHEL6).

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 5 RHEL Program Management 2011-01-11 20:38:22 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.

Comment 6 RHEL Program Management 2011-01-11 23:01:36 UTC
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.

Comment 12 errata-xmlrpc 2011-05-18 14:57:19 UTC
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-2011-0816.html