Move /var/svc/log to /var/log/svc
[unleashed/lotheac.git] / share / man / man8 / acct.8
blobc38abba2ef0333ef9ea65af40a407db5bc594d4a
1 '\" te
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 8 "Feb 22, 1999"
7 .SH NAME
8 acct, acctdisk, acctdusg, accton, acctwtmp, closewtmp, utmp2wtmp \- overview of
9 accounting and miscellaneous accounting commands
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fB/usr/lib/acct/acctdisk\fR
14 .fi
16 .LP
17 .nf
18 \fB/usr/lib/acct/acctdusg\fR [\fB-u\fR \fIfilename\fR] [\fB-p\fR \fIfilename\fR]
19 .fi
21 .LP
22 .nf
23 \fB/usr/lib/acct/accton\fR [\fIfilename\fR]
24 .fi
26 .LP
27 .nf
28 \fB/usr/lib/acct/acctwtmp\fR \fIreason\fR \fIfilename\fR
29 .fi
31 .LP
32 .nf
33 \fB/usr/lib/acct/closewtmp\fR
34 .fi
36 .LP
37 .nf
38 \fB/usr/lib/acct/utmp2wtmp\fR
39 .fi
41 .SH DESCRIPTION
42 .sp
43 .LP
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(8) describes the set of shell procedures built on top of the C
47 programs.
48 .sp
49 .LP
50 Connect time accounting is handled by various programs that write records into
51 \fB/var/log/wtmpx\fR, as described in \fButmpx\fR(4). The programs described in
52 \fBacctcon\fR(8) convert this file into session and charging records, which
53 are then summarized by \fBacctmerg\fR(8).
54 .sp
55 .LP
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/log/pacct\fR). The programs in \fBacctprc\fR(8) summarize this data
59 for charging purposes; \fBacctcms\fR(8) is used to summarize command usage.
60 Current process data may be examined using \fBacctcom\fR(1).
61 .sp
62 .LP
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(8)) is used to format any or all accounting records.
68 .sp
69 .LP
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.
74 .sp
75 .LP
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
78 blocks) by login.
79 .sp
80 .LP
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)).
84 .sp
85 .LP
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:
92 .sp
93 .in +2
94 .nf
95 acctwtmp "acctg on" /var/log/wtmpx
96 acctwtmp "acctg off" /var/log/wtmpx
97 .fi
98 .in -2
102 For each user currently logged on, \fBclosewtmp\fR puts a false
103 \fBDEAD_PROCESS\fR record in the \fB/var/log/wtmpx\fR file. \fBrunacct\fR (see
104 \fBrunacct\fR(8)) 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/log/wtmpx\fR, created by \fBrunacct\fR. Entries in
111 \fB/var/log/wtmpx\fR enable subsequent invocations of \fBrunacct\fR to account
112 for connect times of users currently logged in.
113 .SH OPTIONS
116 The following options are supported:
118 .ne 2
120 \fB\fB-u\fR \fIfilename\fR\fR
122 .RS 15n
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
125 avoid disk charges).
129 .ne 2
131 \fB\fB-p\fR \fIfilename\fR\fR
133 .RS 15n
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.
150 .ne 2
152 \fB\fBLC_CTYPE\fR\fR
154 .RS 12n
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.
164 .ne 2
166 \fB\fBLC_TIME\fR\fR
168 .RS 12n
169 Determines how \fBacct\fR handles date and time formats. In the "C" locale,
170 date and time handling follows the U.S. rules.
173 .SH FILES
175 .ne 2
177 \fB\fB/etc/passwd\fR\fR
179 .RS 18n
180 Used for login name to user \fBID\fR conversions.
184 .ne 2
186 \fB\fB/usr/lib/acct\fR\fR
188 .RS 18n
189 Holds all accounting commands listed in sub-class 8 of this manual.
193 .ne 2
195 \fB\fB/var/log/pacct\fR\fR
197 .RS 18n
198 Current process accounting file.
202 .ne 2
204 \fB\fB/var/log/wtmpx\fR\fR
206 .RS 18n
207 History of user access and administration information..
210 .SH SEE ALSO
213 \fBacctcom\fR(1), \fBacctcms\fR(8), \fBacctcon\fR(8), \fBacctmerg\fR(8),
214 \fBacctprc\fR(8), \fBacctsh\fR(8), \fBfwtmp\fR(8), \fBrunacct\fR(8),
215 \fBacct\fR(2), \fBacct.h\fR(3HEAD), \fBpasswd\fR(4), \fButmpx\fR(4),
216 \fBattributes\fR(5), \fBenviron\fR(5)
219 \fI\fR