bin/120293: sa(8) fails to summarize/truncate accounting data

Cyrus Rahman cr at silva.signetica.com
Tue Feb 5 14:40:02 UTC 2008


>Number:         120293
>Category:       bin
>Synopsis:       sa(8) fails to summarize/truncate accounting data
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 05 14:40:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Cyrus Rahman
>Release:        FreeBSD 7.0-RC1 amd64
>Organization:
>Environment:
System: FreeBSD silva.signetica.com 7.0-RC1 FreeBSD 7.0-RC1 #0: Tue Jan 29 21:59:21 MST 2008 cr at silva.signetica.com:/usr/src/sys/amd64/compile/SIGNETICA amd64


>Description:
	Sa(8) no longer truncates accounting data with the -s flag.  As a
	result, the /etc/periodic/daily script simply copies an ever-growing
	file and the active file grows in length until /var is exhausted.

>How-To-Repeat:
	Enable accounting on a server and wait until that new huge /var is
	full.  Or view the messages from /etc/periodic/daily:

	# sa -s
	sa: converting user accounting stats: Inappropriate file type or format
	sa: user accounting initialization failed

>Fix:
	The version record is correctly written into the user and process
	summary files, but because the compare routine is not specified on the
	database dbopen() in db_copy_in(), this version record is not reliably
	found and the user database is assumed to be a version 1 database.
	Needless to say, the conversion routine fails.

	The following patch corrects the problem:

--- db.c.orig	2008-02-05 07:17:45.000000000 -0700
+++ db.c	2008-02-05 07:18:22.000000000 -0700
@@ -67,7 +67,7 @@
 	if (iflag)
 		return (0);
 
-	if ((ddb = dbopen(dbname, O_RDONLY, 0, DB_BTREE, NULL)) == NULL) {
+	if ((ddb = dbopen(dbname, O_RDONLY, 0, DB_BTREE, bti)) == NULL) {
 		if (errno == ENOENT)
 			return (0);
 		warn("retrieving %s summary", uname);
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list