+++ 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
create 644 root root
/sbin/service httpd reload > /dev/null 2>/dev/null || true
Version-Release number of selected component (if applicable):
Created attachment 424120 [details]
This patch fixes described bug.
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
Committed in CVS, fixed in logrotate-3_7_8-9_el6.
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.
Committed in CVS, fixed in logrotate-3.7.8-12.el6.
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.