1 .\" $NetBSD: utmp.5,v 1.14 2004/02/17 12:32:25 grant Exp $
3 .\" Copyright (c) 1980, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)utmp.5 8.2 (Berkeley) 3/17/94
45 declares the structures used to record information about current
48 logins and logouts in the file
50 and last logins in the file
52 The time stamps of date changes, shutdowns and reboots are also logged in
59 file can grow rapidly on busy systems, and is normally rotated with
62 These files must be created manually;
63 if they do not exist, they are not created automatically.
64 .Bd -literal -offset indent
65 #define _PATH_UTMP "/var/run/utmp"
66 #define _PATH_WTMP "/var/log/wtmp"
67 #define _PATH_LASTLOG "/var/log/lastlog"
71 #define UT_HOSTSIZE 16
75 char ll_line[UT_LINESIZE];
76 char ll_host[UT_HOSTSIZE];
80 char ut_line[UT_LINESIZE];
81 char ut_name[UT_NAMESIZE];
82 char ut_host[UT_HOSTSIZE];
87 Each time a user logs in, the
89 program looks up the user's
93 If it is found, the timestamp of the last time the user logged
94 in, the terminal line and the hostname
95 are written to the standard output, providing the login is not set
101 program then records the new login time in the file
114 record for the user inserted.
115 This record remains there until
116 the user logs out at which time it is deleted (by clearing
117 the user and host fields, and updating the timestamp field).
120 file is used by the programs
129 program opens the file
131 and appends the user's
134 When the user logs out, a
136 record with the tty line, an updated time stamp, and cleared user and host
137 fields is appended to the file by
141 file is used by the programs
146 In the event of a date change, a shutdown or reboot, the
147 following items are logged in the
151 .Bl -tag -width shutdownxx -compact
154 A system reboot or shutdown has been initiated.
157 is placed in the field
171 The system time has been manually or automatically updated by
175 is recorded in the field
181 indicates the time prior to the change, and the character
183 indicates the new time.
186 .Bl -tag -width /var/log/lastlog -compact
195 .It Pa /var/log/lastlog
215 file format appeared in
219 file format appeared in