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