171d8432fSEd Schouten.\" Copyright (c) 2011-2012 Ed Schouten <ed@FreeBSD.org> 271d8432fSEd Schouten.\" All rights reserved. 371d8432fSEd Schouten.\" 471d8432fSEd Schouten.\" Redistribution and use in source and binary forms, with or without 571d8432fSEd Schouten.\" modification, are permitted provided that the following conditions 671d8432fSEd Schouten.\" are met: 771d8432fSEd Schouten.\" 1. Redistributions of source code must retain the above copyright 871d8432fSEd Schouten.\" notice, this list of conditions and the following disclaimer. 971d8432fSEd Schouten.\" 2. Redistributions in binary form must reproduce the above copyright 1071d8432fSEd Schouten.\" notice, this list of conditions and the following disclaimer in the 1171d8432fSEd Schouten.\" documentation and/or other materials provided with the distribution. 1271d8432fSEd Schouten.\" 1371d8432fSEd Schouten.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1471d8432fSEd Schouten.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1571d8432fSEd Schouten.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1671d8432fSEd Schouten.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1771d8432fSEd Schouten.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1871d8432fSEd Schouten.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1971d8432fSEd Schouten.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2071d8432fSEd Schouten.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2171d8432fSEd Schouten.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2271d8432fSEd Schouten.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2371d8432fSEd Schouten.\" SUCH DAMAGE. 2471d8432fSEd Schouten.\" 2523c80c69SEd Schouten.Dd November 3, 2013 2671d8432fSEd Schouten.Dt UTX 8 2771d8432fSEd Schouten.Os 2871d8432fSEd Schouten.Sh NAME 2923c80c69SEd Schouten.Nm utx 3071d8432fSEd Schouten.Nd manage the user accounting database 3171d8432fSEd Schouten.Sh SYNOPSIS 3271d8432fSEd Schouten.Nm 3371d8432fSEd Schouten.Cm boot 3471d8432fSEd Schouten.Nm 3571d8432fSEd Schouten.Cm shutdown 3671d8432fSEd Schouten.Nm 3771d8432fSEd Schouten.Cm rm 3871d8432fSEd Schouten.Ar identifier 3971d8432fSEd Schouten.Ar ... 4071d8432fSEd Schouten.Sh DESCRIPTION 4171d8432fSEd SchoutenThe 4271d8432fSEd Schouten.Nm 4371d8432fSEd Schoutenutility can be used to perform operations on the user accounting 4471d8432fSEd Schoutendatabase, as done by 4571d8432fSEd Schouten.Xr pututxline 3 . 4671d8432fSEd Schouten.Pp 4771d8432fSEd SchoutenThe first argument to 4871d8432fSEd Schouten.Nm 4971d8432fSEd Schoutenindicates an action to be performed: 5071d8432fSEd Schouten.Bl -tag -width ".Cm shutdown" 5171d8432fSEd Schouten.It Cm boot 5271d8432fSEd SchoutenWrite a boot time record to the user accounting database. 5371d8432fSEd SchoutenThis option should typically only be used by 5471d8432fSEd Schouten.Xr rc 8 . 5571d8432fSEd Schouten.It Cm shutdown 5671d8432fSEd SchoutenWrite a shutdown time record to the user accounting database. 5771d8432fSEd SchoutenThis option should typically only be used by 5871d8432fSEd Schouten.Xr rc 8 . 5971d8432fSEd Schouten.It Cm rm 6071d8432fSEd SchoutenRemove stale sessions from the user accounting 6171d8432fSEd Schoutendatabase, by referring to their 6271d8432fSEd Schouten.Ar identifier . 6371d8432fSEd SchoutenStale sessions can occur if a login service exits prematurely or fails 6471d8432fSEd Schoutento remove the session from the accounting database. 6571d8432fSEd Schouten.Pp 6671d8432fSEd SchoutenUtilities such as 6771d8432fSEd Schouten.Xr w 1 6871d8432fSEd Schoutenwill not display the identifier corresponding with a login session, 6971d8432fSEd Schoutensince its value is typically only of use by the process managing the 7071d8432fSEd Schoutenrecord. 7171d8432fSEd SchoutenThe following command can be used to obtain all records from the user 7271d8432fSEd Schoutenaccounting database's active session table, including its identifiers: 7371d8432fSEd Schouten.Pp 7471d8432fSEd Schouten.Dl getent utmpx active 7571d8432fSEd Schouten.Pp 7671d8432fSEd SchoutenIdentifiers can either be supplied in hexadecimal form as displayed by 7771d8432fSEd Schouten.Xr getent 1 , 7871d8432fSEd Schoutenor as a string if the identifier allows such a representation. 7971d8432fSEd Schouten.El 8071d8432fSEd Schouten.Pp 8171d8432fSEd SchoutenBecause this utility requires write-access to the user accounting 8271d8432fSEd Schoutendatabase, its use is limited to the super-user. 8371d8432fSEd Schouten.Sh SEE ALSO 8471d8432fSEd Schouten.Xr getent 1 , 8571d8432fSEd Schouten.Xr w 1 , 86881af8c1SWarren Block.Xr pututxline 3 8771d8432fSEd Schouten.Sh HISTORY 8871d8432fSEd SchoutenThe 8971d8432fSEd Schouten.Nm 9071d8432fSEd Schoutenutility replaced 9171d8432fSEd Schouten.Nm utxrm 9271d8432fSEd Schoutenin 9371d8432fSEd Schouten.Fx 10.0 . 9471d8432fSEd Schouten.Sh AUTHORS 95*01c2b8acSBaptiste Daroussin.An Ed Schouten Aq Mt ed@FreeBSD.org 96