man pages and other misc stuff
[dragonfly.git] / share / man / man5 / utmpx.5
1 .\"     $NetBSD: utmpx.5,v 1.7 2008/04/30 13:10:57 martin Exp $
2 .\"
3 .\" Copyright (c) 2002 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
5 .\"
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Thomas Klausner.
8 .\"
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
11 .\" are met:
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\"    notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in the
16 .\"    documentation and/or other materials provided with the distribution.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
29 .\"
30 .Dd January 31, 2007
31 .Dt UTMPX 5
32 .Os
33 .Sh NAME
34 .Nm utmpx ,
35 .Nm wtmpx ,
36 .Nm lastlogx
37 .Nd user accounting database
38 .Sh SYNOPSIS
39 .In utmpx.h
40 .Sh DESCRIPTION
41 In contrast to
42 .Pa utmp
43 and
44 .Pa wtmp ,
45 the extended databases in
46 .Pa utmpx
47 and
48 .Pa wtmpx
49 reserve more space for logging hostnames, and also
50 information on a process' ID, termination signal and exit status.
51 .Pp
52 The
53 .In utmpx.h
54 header defines the structures and functions for logging user.
55 Currently logged in users are tracked in
56 .Pa /var/run/utmpx ,
57 a list of all logins and logouts, as well as all shutdowns, reboots
58 and date changes, is kept in
59 .Pa /var/log/wtmpx ,
60 and the last login of each user is noted in
61 .Pa /var/log/lastlogx .
62 .Pp
63 The interface to the
64 .Nm utmpx
65 file is described in
66 .Xr getutxent 3 .
67 .Pp
68 The
69 .Nm wtmpx
70 file can grow rapidly on busy systems, and is normally rotated with
71 .Xr newsyslog 8 .
72 .Pp
73 In the event of a date change, a shutdown, or a reboot, the following
74 items are logged in the
75 .Nm wtmpx
76 file:
77 .Bl -tag -width shutdownxx -compact -offset indent
78 .It Li date
79 The system time has been manually or automatically updated by
80 .Xr date 1 .
81 The command name
82 .Em date
83 is recorded in the field
84 .Fa ut_name .
85 In the field
86 .Fa ut_line ,
87 the character
88 .Ql \\*(Ba
89 indicates the time prior to the change, and the character
90 .Ql \&{
91 indicates the new time.
92 .It Li reboot
93 .It Li shutdown
94 A system reboot or shutdown has been initiated.
95 The character
96 .Ql \&~
97 is placed in the field
98 .Fa ut_line ,
99 and
100 .Li reboot
101 or
102 .Li shutdown
103 in the field
104 .Fa ut_name
105 (see
106 .Xr shutdown 8
107 and
108 .Xr reboot 8 ) ,
109 using
110 .Xr logwtmpx 3 .
111 .Pp
112 .El
113 .Sh FILES
114 .Bl -tag -width /var/log/lastlogx -compact
115 .It Pa /var/run/utmpx
116 The
117 .Nm utmpx
118 file.
119 .It Pa /var/log/wtmpx
120 The
121 .Nm wtmpx
122 file.
123 .It Pa /var/log/lastlogx
124 The
125 .Nm lastlogx
126 file.
127 .El
128 .Sh SEE ALSO
129 .Xr last 1 ,
130 .Xr login 1 ,
131 .Xr rwho 1 ,
132 .Xr w 1 ,
133 .Xr who 1 ,
134 .Xr endutxent 3 ,
135 .Xr logwtmpx 3 ,
136 .Xr utmp 5 ,
137 .Xr ac 8 ,
138 .Xr init 8 ,
139 .Xr newsyslog 8 ,
140 .Xr reboot 8