summaryrefslogtreecommitdiff
path: root/usr/src/man/man8/runacct.8
blob: 1c8b2f942df37d340ff2cce61b1d82df54ee1f2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
'\" te
.\"  Copyright 1989 AT&T  Copyright (c) 1999 Sun Microsystems, Inc.  All Rights Reserved.
.\" 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.
.\" 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.
.\" 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]
.TH RUNACCT 8 "May 11, 1999"
.SH NAME
runacct \- run daily accounting
.SH SYNOPSIS
.LP
.nf
\fB/usr/lib/acct/runacct\fR [\fImmdd\fR [\fIstate\fR]]
.fi

.SH DESCRIPTION
.sp
.LP
\fBrunacct\fR is the main daily accounting shell procedure. It is normally
initiated using  \fBcron\fR. \fBrunacct\fR processes connect, fee, disk, and
process accounting files. It also prepares summary files for \fBprdaily\fR or
billing purposes. \fBrunacct\fR is distributed only to source code licensees.
.sp
.LP
\fBrunacct\fR takes care not to damage active accounting files or summary files
in the event of errors. It records its progress by writing descriptive
diagnostic messages into \fBactive\fR. When an error is detected, a message is
written to \fB/dev/console\fR, mail (see \fBmail\fR(1)) is sent to \fBroot\fR
and \fBadm\fR, and \fBrunacct\fR terminates. \fBrunacct\fR uses a series of
lock files to protect against re-invocation. The files \fBlock\fR and
\fBlock1\fR are used to prevent simultaneous invocation, and \fBlastdate\fR is
used to prevent more than one invocation per day.
.sp
.LP
\fBrunacct\fR breaks its processing into separate, restartable \fIstates\fR
using \fBstatefile\fR to remember the last \fIstate\fR completed. It
accomplishes this by writing the \fIstate\fR name into \fBstatefile\fR.
\fBrunacct\fR then looks in \fBstatefile\fR to see what it has done and to
determine what to process next. \fIstates\fR are executed in the following
order:
.sp
.ne 2
.na
\fB\fBSETUP\fR\fR
.ad
.RS 14n
Move active accounting files into working files.
.RE

.sp
.ne 2
.na
\fB\fBWTMPFIX\fR\fR
.ad
.RS 14n
Verify integrity of \fBwtmpx\fR file, correcting date changes if necessary.
.RE

.sp
.ne 2
.na
\fB\fBCONNECT\fR\fR
.ad
.RS 14n
Produce connect session records in \fBtacct.h\fR format.
.RE

.sp
.ne 2
.na
\fB\fBPROCESS\fR\fR
.ad
.RS 14n
Convert process accounting records into \fBtacct.h\fR format.
.RE

.sp
.ne 2
.na
\fB\fBMERGE\fR\fR
.ad
.RS 14n
Merge the connect and process accounting records.
.RE

.sp
.ne 2
.na
\fB\fBFEES\fR\fR
.ad
.RS 14n
Convert output of \fBchargefee\fR into \fBtacct.h\fR format, merge with
connect, and process accounting records.
.RE

.sp
.ne 2
.na
\fB\fBDISK\fR\fR
.ad
.RS 14n
Merge disk accounting records with connect, process, and fee accounting
records.
.RE

.sp
.ne 2
.na
\fB\fBMERGETACCT\fR\fR
.ad
.RS 14n
Merge the daily total accounting records in \fBdaytacct\fR with the summary
total accounting records in \fB/var/adm/acct/sum/tacct\fR.
.RE

.sp
.ne 2
.na
\fB\fBCMS\fR\fR
.ad
.RS 14n
Produce command summaries.
.RE

.sp
.ne 2
.na
\fB\fBUSEREXIT\fR\fR
.ad
.RS 14n
Any installation dependent accounting programs can be included here.
.RE

.sp
.ne 2
.na
\fB\fBCLEANUP\fR\fR
.ad
.RS 14n
Clean up temporary files and exit. To restart \fBrunacct\fR after a failure,
first check the \fBactive\fR file for diagnostics, then fix any corrupted data
files, such as \fBpacct\fR or \fBwtmpx\fR. The \fBlock\fR, \fBlock1\fR, and
\fBlastdate\fR files must be removed  before \fBrunacct\fR can be restarted.
The argument \fImmdd\fR is necessary if \fBrunacct\fR is being restarted.
\fImmdd\fR specifies the month and day for which \fBrunacct\fR will rerun the
accounting. The entry point for processing is based on the contents of \fB
statefile\fR; to override this, include the desired \fIstate\fR on the command
line to designate where processing should begin.
.RE

.SH EXAMPLES
.LP
\fBExample 1 \fRStarting \fBrunacct\fR
.sp
.LP
The following example starts \fBrunacct\fR:

.sp
.in +2
.nf
example% nohup runacct 2> /var/adm/acct/nite/fd2log &
.fi
.in -2
.sp

.LP
\fBExample 2 \fRRestarting \fBrunacct\fR
.sp
.LP
The following example restarts \fBrunacct\fR:

.sp
.in +2
.nf
example% nohup runacct 0601 2>> /var/adm/acct/nite/fd2log &
.fi
.in -2
.sp

.LP
\fBExample 3 \fRRestarting \fBrunacct\fR at a Specific State
.sp
.LP
The following example restarts \fBrunacct\fR at a specific state:

.sp
.in +2
.nf
example% nohup runacct 0601 MERGE 2>> /var/adm/acct/nite/fd2log &
.fi
.in -2
.sp

.SH FILES
.sp
.ne 2
.na
\fB\fB/var/adm/wtmpx\fR\fR
.ad
.sp .6
.RS 4n
History of user access and administration information
.RE

.sp
.ne 2
.na
\fB\fB/var/adm/pacct\fR\fIincr\fR\fR
.ad
.sp .6
.RS 4n

.RE

.sp
.ne 2
.na
\fB\fB/var/adm/acct/nite/active\fR\fR
.ad
.sp .6
.RS 4n

.RE

.sp
.ne 2
.na
\fB\fB/var/adm/acct/nite/daytacct\fR\fR
.ad
.sp .6
.RS 4n

.RE

.sp
.ne 2
.na
\fB\fB/var/adm/acct/nite/lock\fR\fR
.ad
.sp .6
.RS 4n

.RE

.sp
.ne 2
.na
\fB\fB/var/adm/acct/nite/lock1\fR\fR
.ad
.sp .6
.RS 4n

.RE

.sp
.ne 2
.na
\fB\fB/var/adm/acct/nite/lastdate\fR\fR
.ad
.sp .6
.RS 4n

.RE

.sp
.ne 2
.na
\fB\fB/var/adm/acct/nite/statefile\fR\fR
.ad
.sp .6
.RS 4n

.RE

.SH SEE ALSO
.sp
.LP
.BR acctcom (1),
.BR mail (1),
.BR acct (2),
.BR acct.h (3HEAD),
.BR utmpx (5),
.BR attributes (7),
.BR acct (8),
.BR acctcms (8),
.BR acctcon (8),
.BR acctmerg (8),
.BR acctprc (8),
.BR acctsh (8),
.BR cron (8),
.BR fwtmp (8)
.SH NOTES
.sp
.LP
It is not recommended to restart \fBrunacct\fR in the \fBSETUP\fR \fIstate\fR.
Run \fBSETUP\fR manually and restart using:
.sp
.LP
\fBrunacct\fR \fImmdd\fR \fBWTMPFIX\fR
.sp
.LP
If \fBrunacct\fR failed in the \fBPROCESS\fR \fIstate,\fR remove the last
\fBptacct\fR file because it will not be complete.
.sp
.LP
The \fBrunacct\fR command can process a maximum of
.RS +4
.TP
.ie t \(bu
.el o
6000 distinct sessions
.RE
.RS +4
.TP
.ie t \(bu
.el o
1000 distinct terminal lines
.RE
.RS +4
.TP
.ie t \(bu
.el o
2000 distinct login names
.RE
.sp
.LP
during a single invocation of the command.  If at some point the actual number
of any one of these items exceeds the maximum, the command will not succeed.
.sp
.LP
Do not invoke \fBrunacct\fR at the same time as \fBckpacct\fR, as there may be
a conflict if both scripts attempt to execute \fBturnacct switch\fR
simultaneously.