Red Hat Bugzilla – Bug 447028
Logrotate of psacct will restart accounting even if the service was stopped
Last modified: 2013-04-12 15:43:29 EDT
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):
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
6. Check that accounting is on again, see that /var/account/pacct is growing again
Accounting will be restarted any time that the logs rotate and there is any
content, independent of the service being started or not.
The postrotate script should run only when the service is started.
This problem could be fixed by changing the postrotate line of
Instead of this:
It should be this:
test -f /var/lock/subsys/psacct && /usr/sbin/accton /var/account/pacct
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.