Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Sep 2011 12:19:02 GMT
From:      Andrey Zonov <andrey@zonov.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/160848: [patch] [etc/periodic] 310.accounting ignore $daily_accounting_save
Message-ID:  <201109201219.p8KCJ2cd002465@red.freebsd.org>
Resent-Message-ID: <201109201220.p8KCK9If008525@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 20 12:20:08 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Andrey Zonov
>Release:        8.2-STABLE
>Organization:
>Environment:
>Description:
Last commit to /etc/periodic/daily/310.accounting broke rotation accounting logs.
>How-To-Repeat:
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.
>Fix:
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
 		[Yy][Ee][Ss])
-		    gzip --keep -f acct.0 || rc=3;;
+		    gzip -f acct.0 || rc=3;;
 	    esac
-
-	    sa -s $daily_accounting_flags /var/account/acct.0 &&
-		unlink acct.0 || rc=3
 	fi;;
 
     *)  rc=0;;


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109201219.p8KCJ2cd002465>