Date: Tue, 5 Feb 2008 07:34:07 -0700 (MST) From: Cyrus Rahman <cr@silva.signetica.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/120293: sa(8) fails to summarize/truncate accounting data Message-ID: <200802051434.m15EY7E7025978@silva.signetica.com> Resent-Message-ID: <200802051440.m15Ee10X057138@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802051434.m15EY7E7025978>