Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jul 1999 11:02:30 +1000 (EST)
From:      andrew@ugh.net.au
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/12737: regex for checking load avergaes is wrong for majordomo
Message-ID:  <19990722010230.2D142154@beebite.ugh.net.au>

next in thread | raw e-mail | index | archive | help

>Number:         12737
>Category:       ports
>Synopsis:       regex for checking load avergaes is wrong for majordomo
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 21 08:10:01 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     Andrew
>Release:        FreeBSD 3.2-STABLE i386
>Organization:
UgH!
>Environment:

majordomo port as cvsupped a few weeks ago.

>Description:

The sample configuration file that is installed for majordomo has a section
that can be uncommented to get majordomo to halt processing if the load averages
get too high.

This section just calls uptime and then uses a regular expression to parse the
output. The regular expression does not match the output for the FreeBSD uptime
command and so processing will never be stopped (due to load averages). This
also causes perl (at least version 5.005_03) to emit a warning about
uninitialised variables when using -w to perl.

>How-To-Repeat:

	

>Fix:

A patch to /usr/ports/mail/majordomo/patches/patch-ab


--- patch-ab.orig	Wed Sep 10 12:52:44 1997
+++ patch-ab	Thu Jul 22 11:00:39 1999
@@ -1,5 +1,5 @@
---- sample.cf.orig	Thu Aug 28 00:00:31 1997
-+++ sample.cf	Wed Sep 10 00:56:10 1997
+--- sample.cf.orig	Thu Aug 28 01:00:31 1997
++++ sample.cf	Thu Jul 22 11:00:18 1999
 @@ -6,11 +6,11 @@
  
  # $whereami -- What machine am I running on?
@@ -47,9 +47,12 @@
  
  # $mailer -- What program and args do I use to send mail to the list?
  # $bounce_mailer -- What is used to send mail anywhere else?
-@@ -82,9 +78,9 @@
+@@ -80,15 +76,15 @@
+ # high by uncommenting the following lines.  THIS ONLY WORKS if your "uptime" 
+ # command (usually found in /usr/bin/uptime or /usr/bsd/uptime) 
  # returns a string like:
- #   5:23pm  up  5:51,  9 users,  load average: 0.19, 0.25, 0.33
+-#   5:23pm  up  5:51,  9 users,  load average: 0.19, 0.25, 0.33
++#   5:23pm  up  5:51,  9 users,  load averages: 0.19, 0.25, 0.33
  #
 -#$max_loadavg = 10;                 # Choose the maximum allowed load
 +$max_loadavg = 10;                 # Choose the maximum allowed load
@@ -59,6 +62,11 @@
  #$uptime = `/usr/bsd/uptime` if -x '/usr/bsd/uptime';     # or uptime is over here.
  #
  #($avg_1_minute, $avg_5_minutes, $avg_15_minutes) = 
+-#    $uptime =~ /average:\s+(\S+),\s+(\S+),\s+(\S+)/;
++#    $uptime =~ /averages:\s+(\S+),\s+(\S+),\s+(\S+)/;
+ #
+ #exit 75 if ($avg_15_minutes >= $max_loadavg);           # E_TEMPFAIL
+ #
 @@ -190,7 +186,7 @@
  # majordomo has r/w permission to.
  # Uses the environment variable TMPDIR, since that's pretty common

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990722010230.2D142154>