xref: /freebsd/usr.sbin/utx/utx.8 (revision 01c2b8ac0d5d7a787a7853f0988b505d26cf8136)
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.\"
2571d8432fSEd Schouten.\" $FreeBSD$
2671d8432fSEd Schouten.\"
2723c80c69SEd Schouten.Dd November 3, 2013
2871d8432fSEd Schouten.Dt UTX 8
2971d8432fSEd Schouten.Os
3071d8432fSEd Schouten.Sh NAME
3123c80c69SEd Schouten.Nm utx
3271d8432fSEd Schouten.Nd manage the user accounting database
3371d8432fSEd Schouten.Sh SYNOPSIS
3471d8432fSEd Schouten.Nm
3571d8432fSEd Schouten.Cm boot
3671d8432fSEd Schouten.Nm
3771d8432fSEd Schouten.Cm shutdown
3871d8432fSEd Schouten.Nm
3971d8432fSEd Schouten.Cm rm
4071d8432fSEd Schouten.Ar identifier
4171d8432fSEd Schouten.Ar ...
4271d8432fSEd Schouten.Sh DESCRIPTION
4371d8432fSEd SchoutenThe
4471d8432fSEd Schouten.Nm
4571d8432fSEd Schoutenutility can be used to perform operations on the user accounting
4671d8432fSEd Schoutendatabase, as done by
4771d8432fSEd Schouten.Xr pututxline 3 .
4871d8432fSEd Schouten.Pp
4971d8432fSEd SchoutenThe first argument to
5071d8432fSEd Schouten.Nm
5171d8432fSEd Schoutenindicates an action to be performed:
5271d8432fSEd Schouten.Bl -tag -width ".Cm shutdown"
5371d8432fSEd Schouten.It Cm boot
5471d8432fSEd SchoutenWrite a boot time record to the user accounting database.
5571d8432fSEd SchoutenThis option should typically only be used by
5671d8432fSEd Schouten.Xr rc 8 .
5771d8432fSEd Schouten.It Cm shutdown
5871d8432fSEd SchoutenWrite a shutdown time record to the user accounting database.
5971d8432fSEd SchoutenThis option should typically only be used by
6071d8432fSEd Schouten.Xr rc 8 .
6171d8432fSEd Schouten.It Cm rm
6271d8432fSEd SchoutenRemove stale sessions from the user accounting
6371d8432fSEd Schoutendatabase, by referring to their
6471d8432fSEd Schouten.Ar identifier .
6571d8432fSEd SchoutenStale sessions can occur if a login service exits prematurely or fails
6671d8432fSEd Schoutento remove the session from the accounting database.
6771d8432fSEd Schouten.Pp
6871d8432fSEd SchoutenUtilities such as
6971d8432fSEd Schouten.Xr w 1
7071d8432fSEd Schoutenwill not display the identifier corresponding with a login session,
7171d8432fSEd Schoutensince its value is typically only of use by the process managing the
7271d8432fSEd Schoutenrecord.
7371d8432fSEd SchoutenThe following command can be used to obtain all records from the user
7471d8432fSEd Schoutenaccounting database's active session table, including its identifiers:
7571d8432fSEd Schouten.Pp
7671d8432fSEd Schouten.Dl getent utmpx active
7771d8432fSEd Schouten.Pp
7871d8432fSEd SchoutenIdentifiers can either be supplied in hexadecimal form as displayed by
7971d8432fSEd Schouten.Xr getent 1 ,
8071d8432fSEd Schoutenor as a string if the identifier allows such a representation.
8171d8432fSEd Schouten.El
8271d8432fSEd Schouten.Pp
8371d8432fSEd SchoutenBecause this utility requires write-access to the user accounting
8471d8432fSEd Schoutendatabase, its use is limited to the super-user.
8571d8432fSEd Schouten.Sh SEE ALSO
8671d8432fSEd Schouten.Xr getent 1 ,
8771d8432fSEd Schouten.Xr w 1 ,
88881af8c1SWarren Block.Xr pututxline 3
8971d8432fSEd Schouten.Sh HISTORY
9071d8432fSEd SchoutenThe
9171d8432fSEd Schouten.Nm
9271d8432fSEd Schoutenutility replaced
9371d8432fSEd Schouten.Nm utxrm
9471d8432fSEd Schoutenin
9571d8432fSEd Schouten.Fx 10.0 .
9671d8432fSEd Schouten.Sh AUTHORS
97*01c2b8acSBaptiste Daroussin.An Ed Schouten Aq Mt ed@FreeBSD.org
98