]> git.saurik.com Git - apple/network_cmds.git/blob - rwhod.tproj/rwhod.8
network_cmds-76.tar.gz
[apple/network_cmds.git] / rwhod.tproj / rwhod.8
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. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\" @(#)rwhod.8 8.2 (Berkeley) 12/11/93
33 .\"
34 .Dd December 11, 1993
35 .Dt RWHOD 8
36 .Os BSD 4.2
37 .Sh NAME
38 .Nm rwhod
39 .Nd system status server
40 .Sh SYNOPSIS
41 .Nm rwhod
42 .Sh DESCRIPTION
43 .Nm Rwhod
44 is the server which maintains the database used by the
45 .Xr rwho 1
46 and
47 .Xr ruptime 1
48 programs. Its operation is predicated on the ability to
49 .Em broadcast
50 messages on a network.
51 .Pp
52 .Nm Rwhod
53 operates as both a producer and consumer of status information.
54 As a producer of information it periodically
55 queries the state of the system and constructs
56 status messages which are broadcast on a network.
57 As a consumer of information, it listens for other
58 .Nm rwhod
59 servers' status messages, validating them, then recording
60 them in a collection of files located in the directory
61 .Pa /var/rwho .
62 .Pp
63 The server transmits and receives messages at the port indicated
64 in the ``rwho'' service specification; see
65 .Xr services 5 .
66 The messages sent and received, are of the form:
67 .Bd -literal -offset indent
68 struct outmp {
69 char out_line[8]; /* tty name */
70 char out_name[8]; /* user id */
71 long out_time; /* time on */
72 };
73
74 struct whod {
75 char wd_vers;
76 char wd_type;
77 char wd_fill[2];
78 int wd_sendtime;
79 int wd_recvtime;
80 char wd_hostname[32];
81 int wd_loadav[3];
82 int wd_boottime;
83 struct whoent {
84 struct outmp we_utmp;
85 int we_idle;
86 } wd_we[1024 / sizeof (struct whoent)];
87 };
88 .Ed
89 .Pp
90 All fields are converted to network byte order prior to
91 transmission. The load averages are as calculated by the
92 .Xr w 1
93 program, and represent load averages over the 5, 10, and 15 minute
94 intervals prior to a server's transmission; they are multiplied by 100
95 for representation in an integer. The host name
96 included is that returned by the
97 .Xr gethostname 2
98 system call, with any trailing domain name omitted.
99 The array at the end of the message contains information about
100 the users logged in to the sending machine. This information
101 includes the contents of the
102 .Xr utmp 5
103 entry for each non-idle terminal line and a value indicating the
104 time in seconds since a character was last received on the terminal line.
105 .Pp
106 Messages received by the
107 .Xr rwho
108 server are discarded unless they originated at an
109 .Xr rwho
110 server's port. In addition, if the host's name, as specified
111 in the message, contains any unprintable
112 .Tn ASCII
113 characters, the
114 message is discarded. Valid messages received by
115 .Nm rwhod
116 are placed in files named
117 .Pa whod.hostname
118 in the directory
119 .Pa /var/rwho .
120 These files contain only the most recent message, in the
121 format described above.
122 .Pp
123 Status messages are generated approximately once every
124 3 minutes.
125 .Nm Rwhod
126 performs an
127 .Xr nlist 3
128 on
129 .Pa /vmunix
130 every 30 minutes to guard against
131 the possibility that this file is not the system
132 image currently operating.
133 .Sh SEE ALSO
134 .Xr rwho 1 ,
135 .Xr ruptime 1
136 .Sh BUGS
137 There should be a way to relay status information between networks.
138 Status information should be sent only upon request rather than continuously.
139 People often interpret the server dying
140 or network communication failures
141 as a machine going down.
142 .Sh HISTORY
143 The
144 .Nm
145 command appeared in
146 .Bx 4.2 .