RWHOD(8)

๐Ÿ“ฆ
version 0.17 ยท 4 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

โœจ RWHOD(8) โœจ

okay so bestie, welcome to the System Manager's Manual entry for rwhod ๐Ÿ’– โ€” yes the 8 means it's a system admin thing, we love a little privileged moment, periodt.


๐ŸŒธ NAME ๐ŸŒธ

rwhod โ€” system status server ๐Ÿ–ฅ๏ธโœจ


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

rwhod [-bpaf] [-i <if>...] [-u user]

that's it, that's the whole vibe. five letters of flags and a whole lot of gossip on your network. ๐Ÿ’…


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

So. rwhod is the server that maintains the database used by the rwho(1) and ruptime(1) programs. Its whole operation is predicated on the ability to broadcast messages on a network โ€” like, if you can't broadcast, the girl cannot function, no cap. ๐Ÿ“ก

rwhod operates as both a producer and consumer of status information. Two jobs, one icon. ๐Ÿ’…

  • As a producer of information, it periodically queries the state of the system and constructs status messages which are broadcast on a network. She's posting, fr fr. ๐Ÿ“ค
  • As a consumer of information, it listens for other rwhod servers' status messages, validating them, then recording them in a collection of files located in the directory /var/spool/rwho. She's also lurking and taking notes. Obsessed. ๐Ÿ‘€

The server transmits and receives messages at the port indicated in the `rwho` service specification; see services(5). iykyk ๐Ÿ”Œ

The messages sent and received are of the form:

struct  outmp {
        char    out_line[8];            /* tty name */
        char    out_name[8];            /* user id */
        long    out_time;               /* time on */
};

struct  whod {
        char    wd_vers;
        char    wd_type;
        char    wd_fill[2];
        int     wd_sendtime;
        int     wd_recvtime;
        char    wd_hostname[32];
        int     wd_loadav[3];
        int     wd_boottime;
        struct  whoent {
                struct  outmp we_utmp;
                int     we_idle;
        } wd_we[1024 / sizeof (struct whoent)];
};

look at that struct, it's giving data structure realness ๐Ÿ’€

All fields are converted to network byte order prior to transmission. Little endian girlies, we're flipping before we send. ๐Ÿ”„

The load averages are as calculated by the w(1) program, and represent load averages over the 5, 10, and 15 minute intervals prior to a server's transmission; they are multiplied by 100 for representation in an integer. yes bestie, integers only, we don't do floaties here. ๐Ÿ“ˆ

The host name included is that returned by the gethostname(2) system call, with any trailing domain name omitted. drop the domain, keep it cute. ๐Ÿท๏ธ

The array at the end of the message contains information about the users logged in to the sending machine. This information includes the contents of the utmp(5) entry for each non-idle terminal line and a value indicating the time in seconds since a character was last received on the terminal line. idle girlies do not get a slot, sorry, we're only tracking the ones actually typing. โŒจ๏ธ

Messages received by the rwho server are discarded unless they originated at an rwho server's port. Also, if the host's name, as specified in the message, contains any unprintable ASCII characters, the message is discarded. we do not accept cursed strings in this house. ๐Ÿšซ

Valid messages received by rwhod are placed in files named whod.hostname in the directory /var/spool/rwho. These files contain only the most recent message, in the format described above. out with the old, in with the new, she does not hoard. ๐Ÿ“

Status messages are generated approximately once every 3 minutes. rwhod recomputes the system boot time every 30 minutes because on some (non-Linux) systems it is not a totally reliable process. trauma from other operating systems, we respect it. ๐Ÿ•’


๐Ÿ’… FLAGS ๐Ÿ’…

  • If the -b flag is supplied, only broadcast interfaces, such as ethernets, will be used. ๐Ÿ“ข
  • If the -p flag is supplied, only point-to-point interfaces will be used. ๐Ÿ“ž
  • If the -a flag is supplied, or no flags are supplied, all interfaces will be used. ๐ŸŒ
  • Alternately, you may specify interfaces by name by providing one or more -i options followed by the interface name. ๐Ÿท๏ธ
  • If the -u flag is supplied, rwhod will run as the specified user instead of as rwhod. The initial user until the daemon drops privileges is root. ๐Ÿ‘‘ (yes bestie, root first, then she steps down, very humble of her)
  • rwhod can also forward packets between interfaces if started with -f. Please read the CAVEATS section before enabling rwhod forwarding. ๐Ÿ”€

๐Ÿงš CAVEATS ๐Ÿงš

read this part bestie, it's the important one โš ๏ธ

While rwhod listens on any interface present on the host, it will only send (or forward) to the interfaces determined by the -a -b -p -i flags. she hears everything, but she only speaks to her chosen ones. ๐Ÿ‘‚

When operating in forwarding mode (with -f), rwhod forwards all correct rwhod packets received on an interface to all the other interfaces. You can create a broadcast storm if there is a loop in your network and all the routers in the loop run in forwarding mode. ๐ŸŒ€๐Ÿ˜ญ

To prevent this from happenning, rwhod will shut down forwarding (and log the event to the syslog) if more than one rwhod packet is forwarded per second on average over the last three minutes. she has a self-preservation instinct, we love that for her. ๐Ÿ›‘

If this happens, you must break the loop of forwarding routers. that's on you, babe, she did her part. ๐Ÿซถ


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

rwho(1), ruptime(1) ๐Ÿ’–


๐Ÿ’€ BUGS ๐Ÿ’€

  • Some kind of proxying feature might be useful if your router doesn't run rwhod. manifesting it. ๐Ÿ™ˆ
  • People often interpret the server dying or network communication failures as a machine going down. dramatic much? the machine is fine, the vibes are not. ๐Ÿ˜ญ
  • rwhod doesn't refresh its interface list, which might be useful when using -a -b -p. she is set in her ways, okay, we don't judge. ๐Ÿ’…

๐Ÿ“œ HISTORY ๐Ÿ“œ

The rwhod command appeared in 4.2BSD. ๐Ÿ•ฐ๏ธ

Philippe Troin <phil@fifi.org> implemented forwarding and interface selection flags. shoutout to Philippe, icon behavior, ate and left no crumbs ๐Ÿ‘‘


okay that's the whole page bestie, you're basically a sysadmin now, go forth and broadcast responsibly ๐Ÿฆ‹โœจ

this little love letter came to you from Linux NetKit (0.17), dated March 10, 1999 โ€” old but iconic, we stan a vintage manual page ๐ŸŽ€๐Ÿ’œ

๐Ÿ“ฆ where this page comes from