break out special local mail processing (e.g., mapping to the
[unix-history] / usr / src / usr.sbin / rwhod / rwhod.8
CommitLineData
98a260ad
KB
1.\" Copyright (c) 1983, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
e33ff789 3.\"
4205769b 4.\" %sccs.include.redist.man%
e33ff789 5.\"
653ba8b6 6.\" @(#)rwhod.8 8.2 (Berkeley) %G%
b85fd772 7.\"
b42074ab
CL
8.Dd
9.Dt RWHOD 8
10.Os BSD 4.2
11.Sh NAME
12.Nm rwhod
13.Nd system status server
14.Sh SYNOPSIS
15.Nm rwhod
16.Sh DESCRIPTION
17.Nm Rwhod
e33ff789 18is the server which maintains the database used by the
b42074ab 19.Xr rwho 1
e33ff789 20and
b42074ab 21.Xr ruptime 1
e33ff789 22programs. Its operation is predicated on the ability to
b42074ab 23.Em broadcast
e33ff789 24messages on a network.
b42074ab
CL
25.Pp
26.Nm Rwhod
e33ff789
KM
27operates as both a producer and consumer of status information.
28As a producer of information it periodically
29queries the state of the system and constructs
30status messages which are broadcast on a network.
31As a consumer of information, it listens for other
b42074ab 32.Nm rwhod
e33ff789
KM
33servers' status messages, validating them, then recording
34them in a collection of files located in the directory
b42074ab
CL
35.Pa /var/rwho .
36.Pp
38448290
MK
37The server transmits and receives messages at the port indicated
38in the ``rwho'' service specification; see
b42074ab 39.Xr services 5 .
e33ff789 40The messages sent and received, are of the form:
b42074ab 41.Bd -literal -offset indent
e33ff789
KM
42struct outmp {
43 char out_line[8]; /* tty name */
44 char out_name[8]; /* user id */
45 long out_time; /* time on */
46};
b42074ab 47
e33ff789
KM
48struct whod {
49 char wd_vers;
50 char wd_type;
51 char wd_fill[2];
52 int wd_sendtime;
53 int wd_recvtime;
54 char wd_hostname[32];
55 int wd_loadav[3];
56 int wd_boottime;
57 struct whoent {
58 struct outmp we_utmp;
59 int we_idle;
60 } wd_we[1024 / sizeof (struct whoent)];
61};
b42074ab
CL
62.Ed
63.Pp
e33ff789
KM
64All fields are converted to network byte order prior to
65transmission. The load averages are as calculated by the
b42074ab 66.Xr w 1
e33ff789 67program, and represent load averages over the 5, 10, and 15 minute
38448290
MK
68intervals prior to a server's transmission; they are multiplied by 100
69for representation in an integer. The host name
e33ff789 70included is that returned by the
b42074ab 71.Xr gethostname 2
38448290 72system call, with any trailing domain name omitted.
e33ff789
KM
73The array at the end of the message contains information about
74the users logged in to the sending machine. This information
75includes the contents of the
b42074ab 76.Xr utmp 5
e33ff789 77entry for each non-idle terminal line and a value indicating the
38448290 78time in seconds since a character was last received on the terminal line.
b42074ab 79.Pp
e33ff789 80Messages received by the
b42074ab 81.Xr rwho
38448290 82server are discarded unless they originated at an
b42074ab 83.Xr rwho
e33ff789 84server's port. In addition, if the host's name, as specified
b42074ab
CL
85in the message, contains any unprintable
86.Tn ASCII
87characters, the
e33ff789 88message is discarded. Valid messages received by
b42074ab 89.Nm rwhod
e33ff789 90are placed in files named
b42074ab 91.Pa whod.hostname
e33ff789 92in the directory
b42074ab 93.Pa /var/rwho .
e33ff789
KM
94These files contain only the most recent message, in the
95format described above.
b42074ab 96.Pp
e33ff789 97Status messages are generated approximately once every
38448290 983 minutes.
b42074ab 99.Nm Rwhod
e33ff789 100performs an
b42074ab
CL
101.Xr nlist 3
102on
103.Pa /vmunix
104every 30 minutes to guard against
e33ff789
KM
105the possibility that this file is not the system
106image currently operating.
b42074ab
CL
107.Sh SEE ALSO
108.Xr rwho 1 ,
109.Xr ruptime 1
110.Sh BUGS
38448290
MK
111There should be a way to relay status information between networks.
112Status information should be sent only upon request rather than continuously.
113People often interpret the server dying
653ba8b6 114or network communication failures
e33ff789 115as a machine going down.
b42074ab
CL
116.Sh HISTORY
117The
118.Nm
119command appeared in
120.Bx 4.2 .