2 .\" Copyright 1989 AT&T Copyright (c) 2000, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH ACCT 1M "Feb 22, 1999"
8 acct, acctdisk, acctdusg, accton, acctwtmp, closewtmp, utmp2wtmp \- overview of
9 accounting and miscellaneous accounting commands
13 \fB/usr/lib/acct/acctdisk\fR
18 \fB/usr/lib/acct/acctdusg\fR [\fB-u\fR \fIfilename\fR] [\fB-p\fR \fIfilename\fR]
23 \fB/usr/lib/acct/accton\fR [\fIfilename\fR]
28 \fB/usr/lib/acct/acctwtmp\fR \fIreason\fR \fIfilename\fR
33 \fB/usr/lib/acct/closewtmp\fR
38 \fB/usr/lib/acct/utmp2wtmp\fR
44 Accounting software is structured as a set of tools (consisting of both C
45 programs and shell procedures) that can be used to build accounting systems.
46 \fBacctsh\fR(1M) describes the set of shell procedures built on top of the C
50 Connect time accounting is handled by various programs that write records into
51 \fB/var/adm/wtmpx\fR, as described in \fButmpx\fR(4). The programs described in
52 \fBacctcon\fR(1M) convert this file into session and charging records, which
53 are then summarized by \fBacctmerg\fR(1M).
56 Process accounting is performed by the system kernel. Upon termination of a
57 process, one record per process is written to a file (normally
58 \fB/var/adm/pacct\fR). The programs in \fBacctprc\fR(1M) summarize this data
59 for charging purposes; \fBacctcms\fR(1M) is used to summarize command usage.
60 Current process data may be examined using \fBacctcom\fR(1).
63 Process accounting records and connect time accounting records (or any
64 accounting records in the \fBtacct\fR format described in \fBacct.h\fR(3HEAD))
65 can be merged and summarized into total accounting records by \fBacctmerg\fR
66 (see \fBtacct\fR format in \fBacct.h\fR(3HEAD)). \fBprtacct\fR (see
67 \fBacctsh\fR(1M)) is used to format any or all accounting records.
70 \fBacctdisk\fR reads lines that contain user \fBID\fR, login name, and number
71 of disk blocks and converts them to total accounting records that can be merged
72 with other accounting records. \fBacctdisk\fR returns an error if the input
73 file is corrupt or improperly formatted.
76 \fBacctdusg\fR reads its standard input (usually from \fBfind\fR \fB/\fR
77 \fB-\fR\fBprint\fR) and computes disk resource consumption (including indirect
81 \fBaccton\fR without arguments turns process accounting off. If \fIfilename\fR
82 is given, it must be the name of an existing file, to which the kernel appends
83 process accounting records (see \fBacct\fR(2) and \fBacct.h\fR(3HEAD)).
86 \fBacctwtmp\fR writes a \fButmpx\fR(4) record to \fIfilename\fR. The record
87 contains the current time and a string of characters that describe the
88 \fIreason\fR. A record type of \fBACCOUNTING\fR is assigned (see
89 \fButmpx\fR(4)) \fIreason\fR must be a string of 11 or fewer characters,
90 numbers, \fB$\fR, or spaces. For example, the following are suggestions for use
91 in reboot and shutdown procedures, respectively:
95 acctwtmp "acctg on" /var/adm/wtmpx
96 acctwtmp "acctg off" /var/adm/wtmpx
102 For each user currently logged on, \fBclosewtmp\fR puts a false
103 \fBDEAD_PROCESS\fR record in the \fB/var/adm/wtmpx\fR file. \fBrunacct\fR (see
104 \fBrunacct\fR(1M)) uses this false \fBDEAD_PROCESS\fR record so that the
105 connect accounting procedures can track the time used by users logged on before
106 \fBrunacct\fR was invoked.
109 For each user currently logged on, \fBrunacct\fR uses \fButmp2wtmp\fR to create
110 an entry in the file \fB/var/adm/wtmpx\fR, created by \fBrunacct\fR. Entries in
111 \fB/var/adm/wtmpx\fR enable subsequent invocations of \fBrunacct\fR to account
112 for connect times of users currently logged in.
116 The following options are supported:
120 \fB\fB-u\fR \fIfilename\fR\fR
123 Places in \fIfilename\fR records consisting of those filenames for which
124 \fBacctdusg\fR charges no one (a potential source for finding users trying to
131 \fB\fB-p\fR \fIfilename\fR\fR
134 Specifies a password file, \fIfilename\fR. This option is not needed if the
135 password file is \fB/etc/passwd\fR.
138 .SH ENVIRONMENT VARIABLES
141 If any of the \fBLC_*\fR variables (\fBLC_TYPE\fR, \fBLC_MESSAGES\fR,
142 \fBLC_TIME\fR, \fBLC_COLLATE\fR, \fBLC_NUMERIC\fR, and \fBLC_MONETARY\fR) (see
143 \fBenviron\fR(5)) are not set in the environment, the operational behavior of
144 \fBacct\fR for each corresponding locale category is determined by the value of
145 the \fBLANG\fR environment variable. If \fBLC_ALL\fR is set, its contents are
146 used to override both the \fBLANG\fR and the other \fBLC_*\fR variables. If
147 none of the above variables are set in the environment, the "C" (U.S. style)
148 locale determines how \fBacct\fR behaves.
155 Determines how \fBacct\fR handles characters. When \fBLC_CTYPE\fR is set to a
156 valid value, \fBacct\fR can display and handle text and filenames containing
157 valid characters for that locale. \fBacct\fR can display and handle Extended
158 Unix Code (EUC) characters where any character can be 1, 2, or 3 bytes wide.
159 \fBacct\fR can also handle EUC characters of 1, 2, or more column widths. In
160 the "C" locale, only characters from ISO 8859-1 are valid.
169 Determines how \fBacct\fR handles date and time formats. In the "C" locale,
170 date and time handling follows the U.S. rules.
177 \fB\fB/etc/passwd\fR\fR
180 Used for login name to user \fBID\fR conversions.
186 \fB\fB/usr/lib/acct\fR\fR
189 Holds all accounting commands listed in sub-class 1M of this manual.
195 \fB\fB/var/adm/pacct\fR\fR
198 Current process accounting file.
204 \fB\fB/var/adm/wtmpx\fR\fR
207 History of user access and administration information..
213 \fBacctcom\fR(1), \fBacctcms\fR(1M), \fBacctcon\fR(1M), \fBacctmerg\fR(1M),
214 \fBacctprc\fR(1M), \fBacctsh\fR(1M), \fBfwtmp\fR(1M), \fBrunacct\fR(1M),
215 \fBacct\fR(2), \fBacct.h\fR(3HEAD), \fBpasswd\fR(4), \fButmpx\fR(4),
216 \fBattributes\fR(5), \fBenviron\fR(5)