diff --git a/usr.sbin/rwhod/rwhod.8 b/usr.sbin/rwhod/rwhod.8 index f1aa636e6bf4..8050ca97f425 100644 --- a/usr.sbin/rwhod/rwhod.8 +++ b/usr.sbin/rwhod/rwhod.8 @@ -40,6 +40,7 @@ .Sh SYNOPSIS .Nm rwhod .Op Fl i +.Op Fl l .Op Fl m Op Ar ttl .Sh DESCRIPTION .Nm Rwhod @@ -54,7 +55,11 @@ or messages on a network. .Pp .Nm Rwhod -operates as both a producer and consumer of status information. +operates as both a producer and consumer of status information, +unless the +.Fl l +(listen mode) option is specified, in which case +it acts as a consumer only. As a producer of information it periodically queries the state of the system and constructs status messages which are broadcasted or multicasted on a network. @@ -71,6 +76,15 @@ option enables insecure mode, which causes to ignore the source port on incoming packets. .Pp The +.Fl l +option enables listen mode, which causes +.Nm +to not broadcast any information. +This allows you to monitor other machines' +.Nm +information, without broadcasting your own. +.Pp +The .Fl m option causes .Nm diff --git a/usr.sbin/rwhod/rwhod.c b/usr.sbin/rwhod/rwhod.c index dcd6defc5183..6b6899f6b274 100644 --- a/usr.sbin/rwhod/rwhod.c +++ b/usr.sbin/rwhod/rwhod.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)rwhod.c 8.1 (Berkeley) 6/6/93"; #endif static const char rcsid[] = - "$Id: rwhod.c,v 1.7 1997/10/13 11:27:55 charnier Exp $"; + "$Id: rwhod.c,v 1.8 1998/12/17 11:05:57 des Exp $"; #endif /* not lint */ #include @@ -116,6 +116,7 @@ static const char rcsid[] = /* (belongs in protocols/rwhod.h) */ int insecure_mode; +int quiet_mode; int multicast_mode = NO_MULTICAST; int multicast_scope; struct sockaddr_in multicast_addr = { sizeof multicast_addr, AF_INET }; @@ -196,7 +197,9 @@ main(argc, argv) else multicast_mode = PER_INTERFACE_MULTICAST; } else if (strcmp(*argv, "-i") == 0) - insecure_mode = 1; + insecure_mode = 1; + else if (strcmp(*argv, "-l") == 0) + quiet_mode = 1; else usage(); argv++, argc--; @@ -255,8 +258,10 @@ main(argc, argv) setuid(unpriv_uid); if (!configure(s)) exit(1); - signal(SIGALRM, onalrm); - onalrm(0); + if (!quiet_mode) { + signal(SIGALRM, onalrm); + onalrm(0); + } for (;;) { struct whod wd; int cc, whod, len = sizeof(from);