Debian Codegraph @

upstream/fedora-44/man8/rwhod.8

raw
1 .\" Copyright (c) 1983, 1991 The Regents of the University of California.
2 .\" 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 .\" from: @(#)rwhod.8 6.5 (Berkeley) 3/16/91
33 .\" $Id: rwhod.8,v 1.16 2000/07/30 23:57:06 dholland Exp $
34 .\"
35 .Dd May 13, 1997
36 .Dt RWHOD 8
37 .Os "Linux NetKit (0.17)"
38 .Sh NAME
39 .Nm rwhod
40 .Nd system status server
41 .Sh SYNOPSIS
42 .Nm rwhod
43 .Op Fl bpa
44 .Op Fl u Ar user
45 .Sh DESCRIPTION
46 .Nm Rwhod
47 is the server which maintains the database used by the
48 .Xr rwho 1
49 and
50 .Xr ruptime 1
51 programs. Its operation is predicated on the ability to
52 .Em broadcast
53 messages on a network.
54 .Pp
55 .Nm Rwhod
56 operates as both a producer and consumer of status information.
57 As a producer of information it periodically
58 queries the state of the system and constructs
59 status messages which are broadcast on a network.
60 As a consumer of information, it listens for other
61 .Nm rwhod
62 servers' status messages, validating them, then recording
63 them in a collection of files located in the directory
64 .Pa /var/spool/rwho .
65 .Pp
66 The server transmits and receives messages at the port indicated
67 in the ``rwho'' service specification; see
68 .Xr services 5 .
69 .Pp
70 If the
71 .Fl b
72 flag is supplied, only broadcast interfaces, such as ethernets, will
73 be used.
74 If the
75 .Fl p
76 flag is supplied, only point-to-point interfaces will be used. If the
77 .Fl a
78 flag is supplied, or no flags are supplied, all interfaces will be
79 used.
80 .Pp
81 If the
82 .Fl u
83 flag is supplied, rwhod will run as the specified user instead of as
84 root.
85 .Pp
86 The messages sent and received, are of the form:
87 .Bd -literal -offset indent
88 struct outmp {
89 char out_line[8]; /* tty name */
90 char out_name[8]; /* user id */
91 long out_time; /* time on */
92 };
93
94 struct whod {
95 char wd_vers;
96 char wd_type;
97 char wd_fill[2];
98 int wd_sendtime;
99 int wd_recvtime;
100 char wd_hostname[32];
101 int wd_loadav[3];
102 int wd_boottime;
103 struct whoent {
104 struct outmp we_utmp;
105 int we_idle;
106 } wd_we[1024 / sizeof (struct whoent)];
107 };
108 .Ed
109 .Pp
110 All fields are converted to network byte order prior to
111 transmission. The load averages are as calculated by the
112 .Xr w 1
113 program, and represent load averages over the 5, 10, and 15 minute
114 intervals prior to a server's transmission; they are multiplied by 100
115 for representation in an integer. The host name
116 included is that returned by the
117 .Xr gethostname 2
118 system call, with any trailing domain name omitted.
119 The array at the end of the message contains information about
120 the users logged in to the sending machine. This information
121 includes the contents of the
122 .Xr utmp 5
123 entry for each non-idle terminal line and a value indicating the
124 time in seconds since a character was last received on the terminal line.
125 .Pp
126 Messages received by the
127 .Xr rwho
128 server are discarded unless they originated at an
129 .Xr rwho
130 server's port. In addition, if the host's name, as specified
131 in the message, contains any unprintable
132 .Tn ASCII
133 characters, the
134 message is discarded. Valid messages received by
135 .Nm rwhod
136 are placed in files named
137 .Pa whod.hostname
138 in the directory
139 .Pa /var/spool/rwho .
140 These files contain only the most recent message, in the
141 format described above.
142 .Pp
143 Status messages are generated approximately once every
144 3 minutes.
145 .Nm Rwhod
146 recomputes the system boot time every 30 minutes because on
147 some (non-Linux) systems it is not a totally reliable process.
148 .Sh SEE ALSO
149 .Xr rwho 1 ,
150 .Xr ruptime 1
151 .Sh BUGS
152 There should be a way to relay status information between networks.
153 People often interpret the server dying
154 or network communtication failures
155 as a machine going down.
156 .Sh HISTORY
157 The
158 .Nm
159 command appeared in
160 .Bx 4.2 .