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