Re: Accounting changes



Robert Watson wrote:

On Mon, 9 Apr 2007, Diomidis Spinellis wrote:

I'd like your permission to perform a change during the slush period.

Following some gentle prodding by bde, I'm working on an overhaul of the accounting system. The reason for the change is that time values with AHZ == 64 (1/64 second) are very often zero on modern machines. The change involves storing acct(5) time values as proper IEEE-487 floats with AHZ being 1000000 (i.e storing \mu s). For the change I'll touch the following files/directories:

sys/sys/acct.h
sys/kern/kern_acct.c
usr.sbin/sa
usr.bin/lastcomm
share/man/man5/acct.5
UPDATING

The change will render old daily accounting files incompatible with the new commands and formats. Because the summary databases don't store any version information, the old versions of these will also become unusable. Therefore users will need to clear /var/account{acct*,savacct,usracct}. Apparently, this problem has occurred multiple times in the past, when we changed the size of elements like uid_t and dev_t.

What do you think of the idea of changing the file format a little to include a short file header at the front, and that the first field of that head is zero-filled u_int32_t, and the second a version number? Right now, the first field of the acct structure is the name of the command, which will always be a non-nul string, so always have a first character non-nul. If we see non-nul data in the file header's first field, we use the old structure layout, and otherwise we check the version number and use the new layout? This would provide backwards compatibility for reading old accounting data, which I would think would generally be desirable, and allow us to explicitly version the file in the future.

There are three types of accounting files: acct(5), which contains records written by the kernel, and two others containing sa(8) aggregated results of acct per user and per command. I'd prefer to keep acct(5) free of version data. This 1) simplifies the kernel, which would otherwise have to write version data each time the file is turned over, 2) is consistent with current practice for storing such files, and 3) simplifies the processing programs, which can process data at arbritrary locations in the file. (lastcomm reads records backwards, and recently I updated it to also work on the output of tail -f). Typically, these files are aggregated and turned over daily; IMO doing this also over an OS upgrade isn't a big deal.

The aggregated files are different. They are dbm-based, and their structure is opaque. I could therefore easily add a special "file version" record to them. My concern is how to handle multiple file versions over a long time period. Hard-coding legacy file formats in the code is inelegant. I'd prefer to add a text-based import/export capability, so that administrators can migrate data by exporting it before an OS upgrade and importing it afterwords.

Even that could be an overkill. Based on the problems Bruce and I have seen in the accounting system, my impression is that not many people use it nowadays. Once/if we get dtrace in FreeBSD, I'd prever to scrap t existing accounting infrastructure and re-implement it on top of that.

Diomidis - http://www.spinellis.gr

_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Accounting changes
    ... On Sun, 15 Apr 2007, Diomidis Spinellis wrote: ... Right now, the first field of the acct structure is the name of the command, which will always be a non-nul string, so always have a first character non-nul. ... This would provide backwards compatibility for reading old accounting data, which I would think would generally be desirable, and allow us to explicitly version the file in the future. ...
    (freebsd-arch)
  • Re: In search of Knowledge
    ... ledger accounting system. ... Assuming you are writing an accounting app? ... You have a fairly simple app. ... have two, you can handle many more, especially left-to-right languages like ...
    (comp.object)
  • Re: Pulling info from accounting software to do Invoice reviews
    ... from our accounting system CODA because CODA is not user friendly. ... you're gonna have to talk to the software vendor of that accounting package ...
    (microsoft.public.access.forms)
  • ANN: BS/1 Accounting Distribution Manufacturing Source Code v2008
    ... BS/1 Accounting is an integrated multi-currency accounting system: ... Billing, Sales Analysis, and Bank Reconciliation. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: NKF....Is the case closed and the shit covered up ?
    ... There obviously will be dead bodies and skeletons - running an organization ... with 256 mill donations as receivables means that the accounting system must ... And not all accounting systems can be perfect even when they strive for it. ... >> First they sent the IRAS and now the CAD means there is a criminal ...
    (soc.culture.singapore)