From parag@pinhead.parag.codegen.com Sun Nov 21 11:11:14 1999
Return-Path: <parag@pinhead.parag.codegen.com>
Received: from pinhead.parag.codegen.com (207-44-235-154.CodeGen.COM [207.44.235.154])
	by hub.freebsd.org (Postfix) with ESMTP id F18921584F
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 21 Nov 1999 11:10:47 -0800 (PST)
	(envelope-from parag@pinhead.parag.codegen.com)
Received: (from parag@localhost)
	by pinhead.parag.codegen.com (8.9.3/8.9.3) id LAA59134;
	Sun, 21 Nov 1999 11:10:44 -0800 (PST)
	(envelope-from parag)
Message-Id: <199911211910.LAA59134@pinhead.parag.codegen.com>
Date: Sun, 21 Nov 1999 11:10:44 -0800 (PST)
From: parag@codegen.com
Sender: parag@pinhead.parag.codegen.com
Reply-To: parag@codegen.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: lmmon 0.60 port breaks -s single-shot option
X-Send-Pr-Version: 3.2

>Number:         15023
>Category:       ports
>Synopsis:       lmmon 0.60 port breaks -s single-shot option
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 21 11:20:00 PST 1999
>Closed-Date:    Sun Nov 21 12:01:37 PST 1999
>Last-Modified:  Sun Nov 21 12:01:54 PST 1999
>Originator:     Parag Patel
>Release:        FreeBSD 3.3-STABLE i386
>Organization:
CodeGen, Inc.
>Environment:

	FreeBSD 3.3-STABLE
	ASUS P97-DS dual Pentium-II/300MHz motherboard

>Description:

	The "-s" option does not work any longer in version 0.60.  It
	used to work in 0.55.

	Looking at the code, there appear to be two lines (in the patch
	below) that set the delay to 1 if it is less than zero.  Hoever,
	the -s option sets delay to -1!

	I don't know what the right fix the author would prefer, but the
	hack below allows it to work for me.

	(I have built a script wrapper around lmmon that converts its
	output to a single-line, logs the info via syslog, checks for
	out-of-range conditions, and emails warnings if anything is
	out-of-range.  It still has a ways to go to emulate the upsd
	daemon that monitors the UPS and cleanly shuts the system down.
	Still, it's quite handy for logging the stats via cron.
	However, it needs the patch below to operate.)

>How-To-Repeat:

	Build it and try the -s option.

>Fix:
	

--- lmmon.c-org Tue Nov  2 16:28:20 1999
+++ lmmon.c     Sun Nov 21 11:04:04 1999
@@ -134,8 +134,8 @@
        argc -= optind;
        argv += optind;

-       if (delay < 1)
-               delay = 1;
+       /*if (delay < 1)
+               delay = 1;*/

 #ifndef HAVE_SMB
        interface = INTERFACE_IO;


>Release-Note:
>Audit-Trail:

From: "Chris D. Faulhaber" <jedgar@fxp.org>
To: parag@codegen.com
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: ports/15023: lmmon 0.60 port breaks -s single-shot option
Date: Sun, 21 Nov 1999 14:50:45 -0500 (EST)

 On Sun, 21 Nov 1999 parag@codegen.com wrote:
 
 > >Synopsis:       lmmon 0.60 port breaks -s single-shot option
 > 
 > 	The "-s" option does not work any longer in version 0.60.  It
 > 	used to work in 0.55.
 > 
 > 	Looking at the code, there appear to be two lines (in the patch
 > 	below) that set the delay to 1 if it is less than zero.  Hoever,
 > 	the -s option sets delay to -1!
 > 
 
 This was a 'fix' to prevent someone from specifying a delay of 0 and
 eating up too much processor time.
 
 > 	I don't know what the right fix the author would prefer, but the
 > 	hack below allows it to work for me.
 > 
 
 Why don't you ask me?  My email address is in the port's Makefile and
 DESCR, and in the sources (lmmon.h, lmmon.c, lmmon.8, and README).
 
 > 	(I have built a script wrapper around lmmon that converts its
 > 	output to a single-line, logs the info via syslog, checks for
 > 	out-of-range conditions, and emails warnings if anything is
 > 	out-of-range.  It still has a ways to go to emulate the upsd
 > 	daemon that monitors the UPS and cleanly shuts the system down.
 > 	Still, it's quite handy for logging the stats via cron.
 > 	However, it needs the patch below to operate.)
 > 
 
 Nice to see it's being used...a daemon to do this is in the works; or see
 healthd in the ports.
 
 > >How-To-Repeat:
 > 
 > 	Build it and try the -s option.
 > 
 > >Fix:
 > 	
 > 
 > --- lmmon.c-org Tue Nov  2 16:28:20 1999
 > +++ lmmon.c     Sun Nov 21 11:04:04 1999
 > @@ -134,8 +134,8 @@
 >         argc -= optind;
 >         argv += optind;
 > 
 > -       if (delay < 1)
 > -               delay = 1;
 > +       /*if (delay < 1)
 > +               delay = 1;*/
 
 This was supposed to be:  delay = -1;
 
 Either way, see http://www.fxp.org/~jedgar/lmmon-0.61.tar.gz or wait until
 the PR (ports/15026) that fixes this is committed; or just use your fix :)
 
 -----
 Chris D. Faulhaber               |  You can ISO9001 certify the process of 
 System/Network Administrator,    |  shooting yourself in the foot, so long
 Reality Check Information, Inc.  |  as the process is documented and reliably
 <jedgar@fxp.org>                 |  produces the proper result.
 
 
State-Changed-From-To: open->closed  
State-Changed-By: cpiazza 
State-Changed-When: Sun Nov 21 12:01:37 PST 1999 
State-Changed-Why:  
Fixed in lmmon 0.61 (just committed).  Thanks! 
>Unformatted:
