xref: /freebsd/usr.sbin/rwhod/rwhod.8 (revision 8a7b61203704d362cfbc66c00619f51b24106b55)
1dea673e9SRodney W. Grimes.\" Copyright (c) 1983, 1991, 1993
2dea673e9SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
3dea673e9SRodney W. Grimes.\"
4dea673e9SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
5dea673e9SRodney W. Grimes.\" modification, are permitted provided that the following conditions
6dea673e9SRodney W. Grimes.\" are met:
7dea673e9SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
8dea673e9SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
9dea673e9SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
10dea673e9SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
11dea673e9SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
12fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors
13dea673e9SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
14dea673e9SRodney W. Grimes.\"    without specific prior written permission.
15dea673e9SRodney W. Grimes.\"
16dea673e9SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17dea673e9SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18dea673e9SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19dea673e9SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20dea673e9SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21dea673e9SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22dea673e9SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23dea673e9SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24dea673e9SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25dea673e9SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26dea673e9SRodney W. Grimes.\" SUCH DAMAGE.
27dea673e9SRodney W. Grimes.\"
28*06965400SJeremie Le Hen.Dd August 8, 2017
29dea673e9SRodney W. Grimes.Dt RWHOD 8
30a4c37c81SRuslan Ermilov.Os
31dea673e9SRodney W. Grimes.Sh NAME
32dea673e9SRodney W. Grimes.Nm rwhod
33dea673e9SRodney W. Grimes.Nd system status server
34dea673e9SRodney W. Grimes.Sh SYNOPSIS
35e97407b4SRuslan Ermilov.Nm
36ae94be3fSDag-Erling Smørgrav.Op Fl i
372a7bd795SBrian Somers.Op Fl p
3821358153SSteve Price.Op Fl l
3984f8341eSJordan K. Hubbard.Op Fl m Op Ar ttl
40dea673e9SRodney W. Grimes.Sh DESCRIPTION
41490d5836SPhilippe CharnierThe
42490d5836SPhilippe Charnier.Nm
43490d5836SPhilippe Charnierutility is the server which maintains the database used by the
44dea673e9SRodney W. Grimes.Xr rwho 1
45dea673e9SRodney W. Grimesand
46dea673e9SRodney W. Grimes.Xr ruptime 1
4707bfccd7SRuslan Ermilovprograms.
4807bfccd7SRuslan ErmilovIts operation is predicated on the ability to
49dea673e9SRodney W. Grimes.Em broadcast
5084f8341eSJordan K. Hubbardor
5184f8341eSJordan K. Hubbard.Em multicast
52dea673e9SRodney W. Grimesmessages on a network.
53dea673e9SRodney W. Grimes.Pp
54490d5836SPhilippe CharnierThe
55490d5836SPhilippe Charnier.Nm
56490d5836SPhilippe Charnierutility operates as both a producer and consumer of status information,
5721358153SSteve Priceunless the
5821358153SSteve Price.Fl l
5921358153SSteve Price(listen mode) option is specified, in which case
6021358153SSteve Priceit acts as a consumer only.
61dea673e9SRodney W. GrimesAs a producer of information it periodically
62dea673e9SRodney W. Grimesqueries the state of the system and constructs
6384f8341eSJordan K. Hubbardstatus messages which are broadcasted or multicasted on a network.
64dea673e9SRodney W. GrimesAs a consumer of information, it listens for other
6511588fbdSPhilippe Charnier.Nm
66dea673e9SRodney W. Grimesservers' status messages, validating them, then recording
67dea673e9SRodney W. Grimesthem in a collection of files located in the directory
68dea673e9SRodney W. Grimes.Pa /var/rwho .
69dea673e9SRodney W. Grimes.Pp
708eeb1c8bSPhilippe CharnierThe following options are available:
718eeb1c8bSPhilippe Charnier.Bl -tag -width indent
728eeb1c8bSPhilippe Charnier.It Fl i
738eeb1c8bSPhilippe CharnierEnable insecure mode, which causes
74ae94be3fSDag-Erling Smørgrav.Nm
75ae94be3fSDag-Erling Smørgravto ignore the source port on incoming packets.
768eeb1c8bSPhilippe Charnier.It Fl p
778eeb1c8bSPhilippe CharnierIgnore all
782a7bd795SBrian Somers.Dv POINTOPOINT
7907bfccd7SRuslan Ermilovinterfaces.
8007bfccd7SRuslan ErmilovThis is useful if you do not wish to keep dial on demand
812a7bd795SBrian Somersinterfaces permanently active.
828eeb1c8bSPhilippe Charnier.It Fl l
838eeb1c8bSPhilippe CharnierEnable listen mode, which causes
8421358153SSteve Price.Nm
8521358153SSteve Priceto not broadcast any information.
8621358153SSteve PriceThis allows you to monitor other machines'
8721358153SSteve Price.Nm
8821358153SSteve Priceinformation, without broadcasting your own.
898eeb1c8bSPhilippe Charnier.It Fl m Op Ar ttl
908eeb1c8bSPhilippe CharnierCause
9111588fbdSPhilippe Charnier.Nm
9211588fbdSPhilippe Charnierto use IP multicast (instead of
9384f8341eSJordan K. Hubbardbroadcast) on all interfaces that have
9484f8341eSJordan K. Hubbardthe IFF_MULTICAST flag set in their "ifnet" structs
9507bfccd7SRuslan Ermilov(excluding the loopback interface).
9607bfccd7SRuslan ErmilovThe multicast
9784f8341eSJordan K. Hubbardreports are sent with a time-to-live of 1, to prevent
9884f8341eSJordan K. Hubbardforwarding beyond the directly-connected subnet(s).
9984f8341eSJordan K. Hubbard.Pp
10084f8341eSJordan K. HubbardIf the optional
10184f8341eSJordan K. Hubbard.Ar ttl
10284f8341eSJordan K. Hubbardargument is supplied with the
10384f8341eSJordan K. Hubbard.Fl m
10411588fbdSPhilippe Charnierflag,
10511588fbdSPhilippe Charnier.Nm
10611588fbdSPhilippe Charnierwill send IP multicast datagrams with a
10711588fbdSPhilippe Charniertime-to-live of
10811588fbdSPhilippe Charnier.Ar ttl ,
10911588fbdSPhilippe Charniervia a SINGLE interface rather
11011588fbdSPhilippe Charnierthan all interfaces.
11111588fbdSPhilippe Charnier.Ar ttl
11211588fbdSPhilippe Charniermust be between 0 and
11307bfccd7SRuslan Ermilov32 (or MAX_MULTICAST_SCOPE).
11407bfccd7SRuslan ErmilovNote that
11584f8341eSJordan K. Hubbard.Fl m Ar 1
116a67e435cSChris Costellois different from
11784f8341eSJordan K. Hubbard.Fl m ,
11884f8341eSJordan K. Hubbardin that
11984f8341eSJordan K. Hubbard.Fl m Ar 1
12084f8341eSJordan K. Hubbardspecifies transmission on one interface only.
12184f8341eSJordan K. Hubbard.Pp
12284f8341eSJordan K. HubbardWhen
12384f8341eSJordan K. Hubbard.Fl m
12484f8341eSJordan K. Hubbardis used without a
12584f8341eSJordan K. Hubbard.Ar ttl
12684f8341eSJordan K. Hubbardargument, the program accepts multicast
12711588fbdSPhilippe Charnier.Nm
12807bfccd7SRuslan Ermilovreports from all multicast-capable interfaces.
12907bfccd7SRuslan ErmilovIf a
13084f8341eSJordan K. Hubbard.Ar ttl
13184f8341eSJordan K. Hubbardargument is given, it accepts multicast reports from only one interface, the
13284f8341eSJordan K. Hubbardone on which reports are sent (which may be controlled via the host's routing
13307bfccd7SRuslan Ermilovtable).
13407bfccd7SRuslan ErmilovRegardless of the
13511588fbdSPhilippe Charnier.Fl m
13611588fbdSPhilippe Charnieroption, the program accepts broadcast or
13707bfccd7SRuslan Ermilovunicast reports from all interfaces.
13807bfccd7SRuslan ErmilovThus, this program will hear the
13911588fbdSPhilippe Charnierreports of old, non-multicasting
140e97407b4SRuslan Ermilov.Nm Ns s ,
14111588fbdSPhilippe Charnierbut, if multicasting is used,
14211588fbdSPhilippe Charnierthose old
143e97407b4SRuslan Ermilov.Nm Ns s
1440227791bSRuslan Ermilovwill not hear the reports generated by this program.
1458eeb1c8bSPhilippe Charnier.El
14684f8341eSJordan K. Hubbard.Pp
147dea673e9SRodney W. GrimesThe server transmits and receives messages at the port indicated
148d35f47a3SDag-Erling Smørgravin the ``who'' service specification; see
149dea673e9SRodney W. Grimes.Xr services 5 .
150dea673e9SRodney W. GrimesThe messages sent and received, are of the form:
151dea673e9SRodney W. Grimes.Bd -literal -offset indent
152dea673e9SRodney W. Grimesstruct	outmp {
153dea673e9SRodney W. Grimes	char	out_line[8];		/* tty name */
154dea673e9SRodney W. Grimes	char	out_name[8];		/* user id */
155dea673e9SRodney W. Grimes	long	out_time;		/* time on */
156dea673e9SRodney W. Grimes};
157dea673e9SRodney W. Grimes
158dea673e9SRodney W. Grimesstruct	whod {
159dea673e9SRodney W. Grimes	char	wd_vers;
160dea673e9SRodney W. Grimes	char	wd_type;
161dea673e9SRodney W. Grimes	char	wd_fill[2];
162dea673e9SRodney W. Grimes	int	wd_sendtime;
163dea673e9SRodney W. Grimes	int	wd_recvtime;
164dea673e9SRodney W. Grimes	char	wd_hostname[32];
165dea673e9SRodney W. Grimes	int	wd_loadav[3];
166dea673e9SRodney W. Grimes	int	wd_boottime;
167dea673e9SRodney W. Grimes	struct	whoent {
168dea673e9SRodney W. Grimes		struct	outmp we_utmp;
169dea673e9SRodney W. Grimes		int	we_idle;
170dea673e9SRodney W. Grimes	} wd_we[1024 / sizeof (struct whoent)];
171dea673e9SRodney W. Grimes};
172dea673e9SRodney W. Grimes.Ed
173dea673e9SRodney W. Grimes.Pp
174dea673e9SRodney W. GrimesAll fields are converted to network byte order prior to
17507bfccd7SRuslan Ermilovtransmission.
17607bfccd7SRuslan ErmilovThe load averages are as calculated by the
177dea673e9SRodney W. Grimes.Xr w 1
178dea673e9SRodney W. Grimesprogram, and represent load averages over the 5, 10, and 15 minute
179dea673e9SRodney W. Grimesintervals prior to a server's transmission; they are multiplied by 100
18007bfccd7SRuslan Ermilovfor representation in an integer.
18107bfccd7SRuslan ErmilovThe host name
182dea673e9SRodney W. Grimesincluded is that returned by the
183906c1e27SMike Pritchard.Xr gethostname 3
184dea673e9SRodney W. Grimessystem call, with any trailing domain name omitted.
185dea673e9SRodney W. GrimesThe array at the end of the message contains information about
18607bfccd7SRuslan Ermilovthe users logged in to the sending machine.
18707bfccd7SRuslan ErmilovThis information
1880806dd92SEd Schoutenincludes the contents of the entry from the user accounting database
1890806dd92SEd Schoutenfor each non-idle terminal line and a value indicating the
190dea673e9SRodney W. Grimestime in seconds since a character was last received on the terminal line.
191dea673e9SRodney W. Grimes.Pp
192dea673e9SRodney W. GrimesMessages received by the
193906c1e27SMike Pritchard.Nm rwho
194dea673e9SRodney W. Grimesserver are discarded unless they originated at an
195906c1e27SMike Pritchard.Nm rwho
196ae94be3fSDag-Erling Smørgravserver's port or the
197ae94be3fSDag-Erling Smørgrav.Fl i
19807bfccd7SRuslan Ermilovoption was specified.
19907bfccd7SRuslan ErmilovIn addition, if the host's name, as specified
200dea673e9SRodney W. Grimesin the message, contains any unprintable
201dea673e9SRodney W. Grimes.Tn ASCII
202dea673e9SRodney W. Grimescharacters, the
20307bfccd7SRuslan Ermilovmessage is discarded.
20407bfccd7SRuslan ErmilovValid messages received by
20511588fbdSPhilippe Charnier.Nm
206dea673e9SRodney W. Grimesare placed in files named
207dea673e9SRodney W. Grimes.Pa whod.hostname
208dea673e9SRodney W. Grimesin the directory
209dea673e9SRodney W. Grimes.Pa /var/rwho .
210dea673e9SRodney W. GrimesThese files contain only the most recent message, in the
211dea673e9SRodney W. Grimesformat described above.
212dea673e9SRodney W. Grimes.Pp
213dea673e9SRodney W. GrimesStatus messages are generated approximately once every
214dea673e9SRodney W. Grimes3 minutes.
215dea673e9SRodney W. Grimes.Sh SEE ALSO
216bfd34a4aSWolfram Schneider.Xr ruptime 1 ,
217bfd34a4aSWolfram Schneider.Xr rwho 1
218dea673e9SRodney W. Grimes.Sh HISTORY
219dea673e9SRodney W. GrimesThe
220dea673e9SRodney W. Grimes.Nm
221490d5836SPhilippe Charnierutility appeared in
222dea673e9SRodney W. Grimes.Bx 4.2 .
22359a3c79dSRuslan Ermilov.Sh BUGS
22459a3c79dSRuslan ErmilovStatus information should be sent only upon request rather than continuously.
22559a3c79dSRuslan ErmilovPeople often interpret the server dying
22659a3c79dSRuslan Ermilovor network communication failures
22759a3c79dSRuslan Ermilovas a machine going down.
228