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 44is the server which maintains the database used by the 45.Xr rwho 1 46and 47.Xr ruptime 1 48programs. Its operation is predicated on the ability to 49.Em broadcast 50messages on a network. 51.Pp 52.Nm Rwhod 53operates as both a producer and consumer of status information. 54As a producer of information it periodically 55queries the state of the system and constructs 56status messages which are broadcast on a network. 57As a consumer of information, it listens for other 58.Nm rwhod 59servers' status messages, validating them, then recording 60them in a collection of files located in the directory 61.Pa /var/rwho . 62.Pp 63The server transmits and receives messages at the port indicated 64in the ``rwho'' service specification; see 65.Xr services 5 . 66The messages sent and received, are of the form: 67.Bd -literal -offset indent 68struct outmp { 69 char out_line[8]; /* tty name */ 70 char out_name[8]; /* user id */ 71 long out_time; /* time on */ 72}; 73 74struct 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 90All fields are converted to network byte order prior to 91transmission. The load averages are as calculated by the 92.Xr w 1 93program, and represent load averages over the 5, 10, and 15 minute 94intervals prior to a server's transmission; they are multiplied by 100 95for representation in an integer. The host name 96included is that returned by the 97.Xr gethostname 2 98system call, with any trailing domain name omitted. 99The array at the end of the message contains information about 100the users logged in to the sending machine. This information 101includes the contents of the 102.Xr utmp 5 103entry for each non-idle terminal line and a value indicating the 104time in seconds since a character was last received on the terminal line. 105.Pp 106Messages received by the 107.Xr rwho 108server are discarded unless they originated at an 109.Xr rwho 110server's port. In addition, if the host's name, as specified 111in the message, contains any unprintable 112.Tn ASCII 113characters, the 114message is discarded. Valid messages received by 115.Nm rwhod 116are placed in files named 117.Pa whod.hostname 118in the directory 119.Pa /var/rwho . 120These files contain only the most recent message, in the 121format described above. 122.Pp 123Status messages are generated approximately once every 1243 minutes. 125.Nm Rwhod 126performs an 127.Xr nlist 3 128on 129.Pa /kernel 130every 30 minutes to guard against 131the possibility that this file is not the system 132image currently operating. 133.Sh SEE ALSO 134.Xr rwho 1 , 135.Xr ruptime 1 136.Sh BUGS 137There should be a way to relay status information between networks. 138Status information should be sent only upon request rather than continuously. 139People often interpret the server dying 140or network communication failures 141as a machine going down. 142.Sh HISTORY 143The 144.Nm 145command appeared in 146.Bx 4.2 . 147