xref: /freebsd/usr.sbin/rwhod/rwhod.8 (revision f37852c17391fdf0e8309bcf684384dd0d854e43)
1.\" Copyright (c) 1983, 1991, 1993
2.\"	The Regents of the University of California.  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.\" 3. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"     @(#)rwhod.8	8.2 (Berkeley) 12/11/93
29.\" $FreeBSD$
30.\"
31.Dd July 3, 2017
32.Dt RWHOD 8
33.Os
34.Sh NAME
35.Nm rwhod
36.Nd system status server
37.Sh SYNOPSIS
38.Nm
39.Op Fl i
40.Op Fl p
41.Op Fl l
42.Op Fl m Op Ar ttl
43.Sh DEPRECATION NOTICE
44.Nm
45is deprecated and will be removed from future versions of the
46.Fx
47base system.
48If
49.Nm
50is still required, it can be installed from ports or packages
51(net/bsdrcmds).
52.Sh DESCRIPTION
53The
54.Nm
55utility is the server which maintains the database used by the
56.Xr rwho 1
57and
58.Xr ruptime 1
59programs.
60Its operation is predicated on the ability to
61.Em broadcast
62or
63.Em multicast
64messages on a network.
65.Pp
66The
67.Nm
68utility operates as both a producer and consumer of status information,
69unless the
70.Fl l
71(listen mode) option is specified, in which case
72it acts as a consumer only.
73As a producer of information it periodically
74queries the state of the system and constructs
75status messages which are broadcasted or multicasted on a network.
76As a consumer of information, it listens for other
77.Nm
78servers' status messages, validating them, then recording
79them in a collection of files located in the directory
80.Pa /var/rwho .
81.Pp
82The following options are available:
83.Bl -tag -width indent
84.It Fl i
85Enable insecure mode, which causes
86.Nm
87to ignore the source port on incoming packets.
88.It Fl p
89Ignore all
90.Dv POINTOPOINT
91interfaces.
92This is useful if you do not wish to keep dial on demand
93interfaces permanently active.
94.It Fl l
95Enable listen mode, which causes
96.Nm
97to not broadcast any information.
98This allows you to monitor other machines'
99.Nm
100information, without broadcasting your own.
101.It Fl m Op Ar ttl
102Cause
103.Nm
104to use IP multicast (instead of
105broadcast) on all interfaces that have
106the IFF_MULTICAST flag set in their "ifnet" structs
107(excluding the loopback interface).
108The multicast
109reports are sent with a time-to-live of 1, to prevent
110forwarding beyond the directly-connected subnet(s).
111.Pp
112If the optional
113.Ar ttl
114argument is supplied with the
115.Fl m
116flag,
117.Nm
118will send IP multicast datagrams with a
119time-to-live of
120.Ar ttl ,
121via a SINGLE interface rather
122than all interfaces.
123.Ar ttl
124must be between 0 and
12532 (or MAX_MULTICAST_SCOPE).
126Note that
127.Fl m Ar 1
128is different from
129.Fl m ,
130in that
131.Fl m Ar 1
132specifies transmission on one interface only.
133.Pp
134When
135.Fl m
136is used without a
137.Ar ttl
138argument, the program accepts multicast
139.Nm
140reports from all multicast-capable interfaces.
141If a
142.Ar ttl
143argument is given, it accepts multicast reports from only one interface, the
144one on which reports are sent (which may be controlled via the host's routing
145table).
146Regardless of the
147.Fl m
148option, the program accepts broadcast or
149unicast reports from all interfaces.
150Thus, this program will hear the
151reports of old, non-multicasting
152.Nm Ns s ,
153but, if multicasting is used,
154those old
155.Nm Ns s
156will not hear the reports generated by this program.
157.El
158.Pp
159The server transmits and receives messages at the port indicated
160in the ``who'' service specification; see
161.Xr services 5 .
162The messages sent and received, are of the form:
163.Bd -literal -offset indent
164struct	outmp {
165	char	out_line[8];		/* tty name */
166	char	out_name[8];		/* user id */
167	long	out_time;		/* time on */
168};
169
170struct	whod {
171	char	wd_vers;
172	char	wd_type;
173	char	wd_fill[2];
174	int	wd_sendtime;
175	int	wd_recvtime;
176	char	wd_hostname[32];
177	int	wd_loadav[3];
178	int	wd_boottime;
179	struct	whoent {
180		struct	outmp we_utmp;
181		int	we_idle;
182	} wd_we[1024 / sizeof (struct whoent)];
183};
184.Ed
185.Pp
186All fields are converted to network byte order prior to
187transmission.
188The load averages are as calculated by the
189.Xr w 1
190program, and represent load averages over the 5, 10, and 15 minute
191intervals prior to a server's transmission; they are multiplied by 100
192for representation in an integer.
193The host name
194included is that returned by the
195.Xr gethostname 3
196system call, with any trailing domain name omitted.
197The array at the end of the message contains information about
198the users logged in to the sending machine.
199This information
200includes the contents of the entry from the user accounting database
201for each non-idle terminal line and a value indicating the
202time in seconds since a character was last received on the terminal line.
203.Pp
204Messages received by the
205.Nm rwho
206server are discarded unless they originated at an
207.Nm rwho
208server's port or the
209.Fl i
210option was specified.
211In addition, if the host's name, as specified
212in the message, contains any unprintable
213.Tn ASCII
214characters, the
215message is discarded.
216Valid messages received by
217.Nm
218are placed in files named
219.Pa whod.hostname
220in the directory
221.Pa /var/rwho .
222These files contain only the most recent message, in the
223format described above.
224.Pp
225Status messages are generated approximately once every
2263 minutes.
227The
228.Nm
229utility performs an
230.Xr nlist 3
231on
232.Pa /boot/kernel/kernel
233every 30 minutes to guard against
234the possibility that this file is not the system
235image currently operating.
236.Sh SEE ALSO
237.Xr ruptime 1 ,
238.Xr rwho 1
239.Sh HISTORY
240The
241.Nm
242utility appeared in
243.Bx 4.2 .
244.Sh BUGS
245Status information should be sent only upon request rather than continuously.
246People often interpret the server dying
247or network communication failures
248as a machine going down.
249