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