Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 447028

Summary: Logrotate of psacct will restart accounting even if the service was stopped
Product: Red Hat Enterprise Linux 5 Reporter: Filipe Brandenburger <filbranden>
Component: psacctAssignee: Ivana Varekova <varekova>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 5.1   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2008-0626 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-07-30 13:05:08 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 Filipe Brandenburger 2008-05-17 02:15:36 UTC
Description of problem:

The logrotate script of psacct runs "accton" always, independently of accounting
being enabled or not.



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

psacct-6.3.2-41.1



How reproducible:

Always



Steps to Reproduce:
1. Turn accounting on by running "service psacct start"
2. Leave accounting on until there is some data on /var/account/pacct
3. Turn accounting off by running "service psacct stop"
4. Verify that /var/account/pacct stopped growing
5. Wait for logrotate to run (you should wait two days for this to occur
naturally); alternatively you can force this by running "logrotate -f
/etc/logrotate.conf"
6. Check that accounting is on again, see that /var/account/pacct is growing again



Actual results:

Accounting will be restarted any time that the logs rotate and there is any
content, independent of the service being started or not.



Expected results:

The postrotate script should run only when the service is started.



Additional info:

This problem could be fixed by changing the postrotate line of
/etc/logrotate.d/psacct

Instead of this:
        /usr/sbin/accton /var/account/pacct

It should be this:
        test -f /var/lock/subsys/psacct && /usr/sbin/accton /var/account/pacct

Comment 5 errata-xmlrpc 2008-07-30 13:05:08 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-2008-0626.html