Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Apr 2002 14:43:23 -0700 (PDT)
From:      Ralph Meijer <gnats-freebsd@ralphm.ik.nu>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/37047: daily_status_mailq_shorten doesn't produce correct output
Message-ID:  <200204132143.g3DLhNk92878@freefall.freebsd.org>

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

>Number:         37047
>Category:       misc
>Synopsis:       daily_status_mailq_shorten doesn't produce correct output
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 13 14:50:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Ralph Meijer
>Release:        4.3-RELEASE
>Organization:
>Environment:
FreeBSD web3.olm.nl 4.3-RELEASE FreeBSD 4.3-RELEASE #1: Thu Jan 31 12:42:21 CET 2002     jorisb@web3.olm.nl:/usr/src/sys/compile/WEB3  i386

>Description:
The script /etc/periodic/daily/440.status-mailq doesn't produce the
correct output when the config variable $daily_status_mailq_shorten is
set to "YES". The problem is that there is a second assignment to $rc
so there is no output left to go through wc(1).
>How-To-Repeat:
add the line:
daily_status_mailq_shorten="YES"
to /etc/periodic.conf and run the script with a mailq filled with
at least two destination addresses that are the same
>Fix:
This patch solves the problem:

--- 440.status-mailq.orig	Sat Apr 13 23:34:20 2002
+++ 440.status-mailq	Sat Apr 13 23:21:02 2002
@@ -29,12 +29,12 @@
 
 	    rc=$(case "$daily_status_mailq_shorten" in
 		[Yy][Ee][Ss])
-		    rc=$(mailq |
+		    mailq |
 			perl -ne  'print if /^\s+\S+@/' |
 			sort |
 			uniq -c |
 			sort -nr |
-			awk '$1 > 1 {print $1, $2}');;
+			awk '$1 > 1 {print $1, $2}';;
 		*)
 		    mailq;;
 	    esac | tee /dev/stderr | fgrep -v 'mqueue is empty' | wc -l)

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

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




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