Bug 753361

Summary: logrotate script will compress log while possibly being written to
Product: [Fedora] Fedora Reporter: JW <ohtmvyyn>
Component: rsyslogAssignee: Tomas Heinrich <theinric>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: pvrabec, theinric
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-12 01:32:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description JW 2011-11-12 00:48:31 UTC
Description of problem:
The /etc/logrotate.d/syslog script has an error which may result in a log file being compressed while still open and being written to.  The file should contain a 'delaycompress' line to prevent this from happening.

You have to carefully read the logrotate manual to understand the order in which logrotate does things. Normally it is: rotate A, postrotate, compress A, rotate B, postrotate, compress B, ....  But when sharedscripts is in effect the order is: rotate A, compress A, rotate B, compress B, ..., postrotate.

Therefore without 'delaycompress' the logs being compressed will still be opened by the application and possibly will be written to while they are being compressed!

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

How reproducible:
Always

Steps to Reproduce:
1. Quicker to read the logrotate manual and understand why the fault exists rather than undertake the complex series of steps it would require to reproduce.
  
Actual results:


Expected results:


Additional info:
The /etc/logrotate.d/syslog config file is also incorrectly named - it should be named rsyslog to match the remainder of the module (eg rsyslog.conf, init.d/rsyslog, rsyslog.d, rsyslogd.8.gz etc).  That bug was reported many moons ago but it looks like everything has reverted back to a wrongly named syslog file again (if it was ever fixed).

Comment 1 JW 2011-11-12 01:32:22 UTC
Closing because not actually a bug. The documentation is misleading and has fooled others, viz: http://stackoverflow.com/questions/7271945/logrotate-compress-files-after-the-postrotate-script

In actual fact when sharedscripts is in effect the order is: rotate A, rotate B, ..., postrotate, compress A, compress B, ...