xref: /freebsd/usr.sbin/utx/utx.8 (revision 0957b409)
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 November 3, 2013
28.Dt UTX 8
29.Os
30.Sh NAME
31.Nm utx
32.Nd manage the user accounting database
33.Sh SYNOPSIS
34.Nm
35.Cm boot
36.Nm
37.Cm shutdown
38.Nm
39.Cm rm
40.Ar identifier
41.Ar ...
42.Sh DESCRIPTION
43The
44.Nm
45utility can be used to perform operations on the user accounting
46database, as done by
47.Xr pututxline 3 .
48.Pp
49The first argument to
50.Nm
51indicates an action to be performed:
52.Bl -tag -width ".Cm shutdown"
53.It Cm boot
54Write a boot time record to the user accounting database.
55This option should typically only be used by
56.Xr rc 8 .
57.It Cm shutdown
58Write a shutdown time record to the user accounting database.
59This option should typically only be used by
60.Xr rc 8 .
61.It Cm rm
62Remove stale sessions from the user accounting
63database, by referring to their
64.Ar identifier .
65Stale sessions can occur if a login service exits prematurely or fails
66to remove the session from the accounting database.
67.Pp
68Utilities such as
69.Xr w 1
70will not display the identifier corresponding with a login session,
71since its value is typically only of use by the process managing the
72record.
73The following command can be used to obtain all records from the user
74accounting database's active session table, including its identifiers:
75.Pp
76.Dl getent utmpx active
77.Pp
78Identifiers can either be supplied in hexadecimal form as displayed by
79.Xr getent 1 ,
80or as a string if the identifier allows such a representation.
81.El
82.Pp
83Because this utility requires write-access to the user accounting
84database, its use is limited to the super-user.
85.Sh SEE ALSO
86.Xr getent 1 ,
87.Xr w 1 ,
88.Xr pututxline 3
89.Sh HISTORY
90The
91.Nm
92utility replaced
93.Nm utxrm
94in
95.Fx 10.0 .
96.Sh AUTHORS
97.An Ed Schouten Aq Mt ed@FreeBSD.org
98