Bug 825574 - If there is a config error, log is not rotated and its deleted
If there is a config error, log is not rotated and its deleted
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: logrotate (Show other bugs)
5.8
Unspecified Linux
unspecified Severity high
: rc
: ---
Assigned To: Jan Kaluža
qe-baseos-daemons
:
Depends On:
Blocks: 903094
  Show dependency treegraph
 
Reported: 2012-05-27 18:54 EDT by Alex Sersen
Modified: 2013-10-31 21:36 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 903094 (view as bug list)
Environment:
Last Closed: 2013-01-23 02:24:49 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alex Sersen 2012-05-27 18:54:46 EDT
Description of problem:
If there is an error in config file, log is not rotated but its deleted

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

How reproducible:


Steps to Reproduce:
RHTS: http://pkgs.devel.redhat.com/cgit/tests/logrotate/tree/Regression/bz510124-request-that-logrotate-rotate-logs-even-with?id=logrotate-CoreOS-logrotate-Regression-bz510124-request-that-logrotate-rotate-logs-even-with-1_0-4
  
Actual results:
Not rotated log is deleted

Expected results:
No rotation, no deletion

Additional info:
Comment 1 Jan Kaluža 2012-05-29 02:40:57 EDT
This is caused by default logrotate setting for "rotate" variable which is 0. That means no old log file is kept. So if you specify "totate 2", the option is not recognized and "rotate" variable is 0 by default.

There's idea that logrotate should rotate files even when there's non-fatal error in configuration, otherwise logs could eat all the empty space on the drive which could lead to server failure.

Also, normally this would not happen, because /etc/logrotate.conf sets the default value to 2.

I think the best idea is to change the default value of rotate option from 0 to 2 in logrotate's code. But this should be done in upstream/Fedora at first.
Comment 2 Jan Kaluža 2013-01-23 02:24:49 EST
We won't change the default "rotate" value in RHEL. I've cloned this bug for Fedora and will fix the default value of "rotate" directive there. I will close this bug as NOTABUG, because the initial problem is caused by bad configuration.

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