From xaa@alterego.stack.urc.tue.nl  Mon Jul  1 02:57:06 1996
Received: from terra.stack.urc.tue.nl (terra.stack.urc.tue.nl [131.155.140.128])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id CAA14040
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 1 Jul 1996 02:57:05 -0700 (PDT)
Received: from alterego.stack.urc.tue.nl (root@alterego.stack.urc.tue.nl [131.155.141.160]) by terra.stack.urc.tue.nl (8.7.5) with ESMTP id LAA29919 for <FreeBSD-gnats-submit@freebsd.org>; Mon, 1 Jul 1996 11:54:47 +0200 (MET DST)
Received: (from xaa@localhost) by alterego.stack.urc.tue.nl (8.7.5/8.6.12) id LAA13685; Mon, 1 Jul 1996 11:54:40 +0200 (MET DST)
Message-Id: <199607010954.LAA13685@alterego.stack.urc.tue.nl>
Date: Mon, 1 Jul 1996 11:54:40 +0200 (MET DST)
From: xaa@stack.urc.tue.nl
Reply-To: xaa@stack.urc.tue.nl
To: FreeBSD-gnats-submit@freebsd.org
Subject: ruptime and long downtimes
X-Send-Pr-Version: 3.2

>Number:         1361
>Category:       bin
>Synopsis:       ruptime and long downtimes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul  1 03:00:01 PDT 1996
>Closed-Date:    Tue Oct 22 21:18:42 PDT 1996
>Last-Modified:  Tue Nov 27 19:22:26 PST 2001
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: mpp 
Responsible-Changed-When: Wed Jul 3 16:01:36 PDT 1996 
Responsible-Changed-Why:  
Moved pr from "pending" area to the "real" bug area :-). 
State-Changed-From-To: open->closed 
State-Changed-By: scrappy 
State-Changed-When: Tue Oct 22 21:18:42 PDT 1996 
State-Changed-Why:  

Fixed in Rev 1.7 of usr.bin/ruptime/ruptime.c 
>Unformatted:
Submitter-Id:   current-users
Originator:     Mark Huizer
Organization:   MCGV Stack, Eindoven University of Technology
Confidential:   no
Synopsis:       ruptime should skip hosts down for a long time
Severity:       non-critical
Priority:       low
Category:       bin
Release:        FreeBSD 2.2-CURRENT i386
Class:          change-request
Environment: 

	Networked machine with sometimes changing hosts

Description: 

	Machine come and go, and I hate having to remove them all
	the time from /var/rwho.
	Little patch removes lists down for over 4 days from the list.
	(If you haven't noticed they are down in that period, you should
	 turn them off!)

How-To-Repeat: 

	Switch off your favorite luser machine, ignore the users,
	and use ruptime after a few days

Fix: 

Use this patch:

--- ruptime.c.orig	Mon Jul  1 11:20:34 1996
+++ ruptime.c	Mon Jul  1 11:28:37 1996
@@ -64,6 +64,7 @@
 struct	whod awhod;
 
 #define	ISDOWN(h)		(now - (h)->hs_wd->wd_recvtime > 11 * 60)
+#define LEFTEARTH(h)		(now - (h)->hs_wd->wd_recvtime > 4*24*60*60)
 #define	WHDRSIZE	(sizeof (awhod) - sizeof (awhod.wd_we))
 
 size_t nhosts;
@@ -167,6 +168,8 @@
 	qsort(hs, nhosts, sizeof(hs[0]), cmp);
 	for (i = 0; i < nhosts; i++) {
 		hsp = &hs[i];
+		if (LEFTEARTH(hsp))
+			continue;
 		if (ISDOWN(hsp)) {
 			(void)printf("%-12.12s%s\n", hsp->hs_wd->wd_hostname,
 			    interval(now - hsp->hs_wd->wd_recvtime, "down"));
