Bug 133077

Summary: logrotate script may cause lost data
Product: Red Hat Enterprise Linux 3 Reporter: Sean Dilda <agrajag>
Component: psacctAssignee: Ivana Varekova <varekova>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2005-167 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-05-19 23:39:14 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:

Description Sean Dilda 2004-09-21 15:07:54 UTC
The default logrotate script for psacct may cause lost data.

The prerotate script calls 'accton' with no arguments which stops
logging of process accounting until the postrotate script is called. 
Any processes that exit during this period will not be properly
accounted for.

I've tested and verified that if you have process accounting enabled,
then run 'accton' pointing to a new file, it will auotmatically switch
logging over with no period for processes to exit and not get
accounted for.  The kernel's logging is to the inode and not the
filename, so it will follow a file if its moved.  As such, I suggest
removing the 'prerotate' script from the default logrotate config.

I've tested this for a few weeks and it works without problem.  I read
the logrotate code and verified that the log file compression takes
place after the postrotate script, so that won't cause any problems
either.

Comment 1 Tim Powers 2005-05-19 23:39:14 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 the 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-2005-211.html