1.\" Copyright (c) 2011-2012 Ed Schouten <ed@FreeBSD.org> 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23.\" SUCH DAMAGE. 24.\" 25.\" $FreeBSD$ 26.\" 27.Dd February 11, 2012 28.Dt UTX 8 29.Os 30.Sh NAME 31.Nm utx , 32.Nm utxrm 33.Nd manage the user accounting database 34.Sh SYNOPSIS 35.Nm 36.Cm boot 37.Nm 38.Cm shutdown 39.Nm 40.Cm rm 41.Ar identifier 42.Ar ... 43.Nm utxrm 44.Ar identifier 45.Ar ... 46.Sh DESCRIPTION 47The 48.Nm 49utility can be used to perform operations on the user accounting 50database, as done by 51.Xr pututxline 3 . 52.Pp 53The first argument to 54.Nm 55indicates an action to be performed: 56.Bl -tag -width ".Cm shutdown" 57.It Cm boot 58Write a boot time record to the user accounting database. 59This option should typically only be used by 60.Xr rc 8 . 61.It Cm shutdown 62Write a shutdown time record to the user accounting database. 63This option should typically only be used by 64.Xr rc 8 . 65.It Cm rm 66Remove stale sessions from the user accounting 67database, by referring to their 68.Ar identifier . 69Stale sessions can occur if a login service exits prematurely or fails 70to remove the session from the accounting database. 71.Pp 72Utilities such as 73.Xr w 1 74will not display the identifier corresponding with a login session, 75since its value is typically only of use by the process managing the 76record. 77The following command can be used to obtain all records from the user 78accounting database's active session table, including its identifiers: 79.Pp 80.Dl getent utmpx active 81.Pp 82Identifiers can either be supplied in hexadecimal form as displayed by 83.Xr getent 1 , 84or as a string if the identifier allows such a representation. 85.Pp 86To remain backward compatible, this action can also be invoked directly 87by using the 88.Nm utxrm 89command. 90.El 91.Pp 92Because this utility requires write-access to the user accounting 93database, its use is limited to the super-user. 94.Sh SEE ALSO 95.Xr getent 1 , 96.Xr w 1 , 97.Xr pututxline 3 98.Sh HISTORY 99The 100.Nm 101utility replaced 102.Nm utxrm 103in 104.Fx 10.0 . 105.Sh AUTHORS 106.An Ed Schouten Aq ed@FreeBSD.org 107