misc/160848: [patch] [etc/periodic] 310.accounting ignore $daily_accounting_save

Andrey Zonov andrey at zonov.org
Tue Sep 20 12:20:09 UTC 2011

>Number:         160848
>Category:       misc
>Synopsis:       [patch] [etc/periodic] 310.accounting ignore $daily_accounting_save
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 20 12:20:08 UTC 2011
>Originator:     Andrey Zonov
>Release:        8.2-STABLE
Last commit to /etc/periodic/daily/310.accounting broke rotation accounting logs.
Turn on accouting:
echo 'accounting_enable="YES"' > /etc/rc.conf.d/accounting

Check /var/account/ after few days. You will find that there's only one `acct' file.
Patch is in attach.

Patch attached with submission follows:

Index: 310.accounting
--- 310.accounting	(revision 225579)
+++ 310.accounting	(working copy)
@@ -44,13 +44,12 @@
 	    /etc/rc.d/accounting rotate_log || rc=3
+	    sa $daily_accounting_flags /var/account/acct.0 || rc=3
 	    case "$daily_accounting_compress" in
-		    gzip --keep -f acct.0 || rc=3;;
+		    gzip -f acct.0 || rc=3;;
-	    sa -s $daily_accounting_flags /var/account/acct.0 &&
-		unlink acct.0 || rc=3
     *)  rc=0;;


More information about the freebsd-bugs mailing list