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 41In contrast to 42.Pa utmp 43and 44.Pa wtmp , 45the extended databases in 46.Pa utmpx 47and 48.Pa wtmpx 49reserve more space for logging hostnames, and also 50information on a process' ID, termination signal and exit status. 51.Pp 52The 53.In utmpx.h 54header defines the structures and functions for logging user. 55Currently logged in users are tracked in 56.Pa /var/run/utmpx , 57a list of all logins and logouts, as well as all shutdowns, reboots 58and date changes, is kept in 59.Pa /var/log/wtmpx , 60and the last login of each user is noted in 61.Pa /var/log/lastlogx . 62.Pp 63The interface to the 64.Nm utmpx 65file is described in 66.Xr getutxent 3 . 67.Pp 68The 69.Nm wtmpx 70file can grow rapidly on busy systems, and is normally rotated with 71.Xr newsyslog 8 . 72.Pp 73In the event of a date change, a shutdown, or a reboot, the following 74items are logged in the 75.Nm wtmpx 76file: 77.Bl -tag -width shutdownxx -compact -offset indent 78.It Li date 79The system time has been manually or automatically updated by 80.Xr date 1 . 81The command name 82.Em date 83is recorded in the field 84.Fa ut_name . 85In the field 86.Fa ut_line , 87the character 88.Ql \\*(Ba 89indicates the time prior to the change, and the character 90.Ql \&{ 91indicates the new time. 92.It Li reboot 93.It Li shutdown 94A system reboot or shutdown has been initiated. 95The character 96.Ql \&~ 97is placed in the field 98.Fa ut_line , 99and 100.Li reboot 101or 102.Li shutdown 103in the field 104.Fa ut_name 105(see 106.Xr shutdown 8 107and 108.Xr reboot 8 ) , 109using 110.Xr logwtmpx 3 . 111.El 112.Sh FILES 113.Bl -tag -width /var/log/lastlogx -compact 114.It Pa /var/run/utmpx 115The 116.Nm utmpx 117file. 118.It Pa /var/log/wtmpx 119The 120.Nm wtmpx 121file. 122.It Pa /var/log/lastlogx 123The 124.Nm lastlogx 125file. 126.El 127.Sh SEE ALSO 128.Xr last 1 , 129.Xr login 1 , 130.Xr rwho 1 , 131.Xr w 1 , 132.Xr who 1 , 133.Xr endutxent 3 , 134.Xr logwtmpx 3 , 135.Xr utmp 5 , 136.Xr ac 8 , 137.Xr init 8 , 138.Xr newsyslog 8 , 139.Xr reboot 8 140