Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jan 2006 10:46:35 +0100 (CET)
From:      Petr Rehor <prehor@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        gshapiro@FreeBSD.org
Subject:   conf/92299: [patch] /etc/periodic/daily/440.status-mailq exits with 1 even if mail queues are empty.
Message-ID:  <200601250946.k0P9kZf8013013@charon.rx.cz>
Resent-Message-ID: <200601251000.k0PA0JVk058380@freefall.freebsd.org>

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

>Number:         92299
>Category:       conf
>Synopsis:       [patch] /etc/periodic/daily/440.status-mailq exits with 1 even if mail queues are empty.
>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:   Wed Jan 25 10:00:19 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Petr Rehor
>Release:        FreeBSD 6.0-RELEASE-c3 i386
>Organization:
>Environment:
System: FreeBSD charon.rx.cz 6.0-RELEASE-c3 FreeBSD 6.0-RELEASE-c3 #0: Tue Nov 8 20:44:39 UTC 2005 root@marvin.rx.cz:/usr/obj/usr/src/sys/GENERIC i386
>Description:
/etc/periodic/daily/440.status-mailq exits with 1 (some informations on output)
instead of 0 (nothing notable on output) when mail queues are empty .
>How-To-Repeat:
When you have empty mail queues run:

/etc/periodic/daily/440.status-mailq; echo $?
>Fix:

--- 440.status-mailq.diff begins here ---
--- 440.status-mailq.orig	Wed Jan 25 10:28:09 2006
+++ 440.status-mailq	Wed Jan 25 10:38:09 2006
@@ -33,7 +33,7 @@
 		*)
 		    mailq;;
 	    esac | tee /dev/stderr | fgrep -v 'mqueue is empty' | wc -l)
-	    [ $rc -gt 1 ] && rc=1
+	    [ $rc -gt 1 ] && rc=1 || rc=0
 
 	    case "$daily_status_include_submit_mailq" in
 	    [Yy][Ee][Ss])
@@ -42,7 +42,7 @@
 		    echo ""
 		    echo "Mail in submit queue:"
 
-		    rc=$(case "$daily_status_mailq_shorten" in
+		    rc_submit=$(case "$daily_status_mailq_shorten" in
 			[Yy][Ee][Ss])
 			    mailq -Ac |
 				egrep -e '^[[:space:]]+[^[:space:]]+@' |
@@ -53,7 +53,7 @@
 			*)
 			    mailq -Ac;;
 		    esac | tee /dev/stderr | fgrep -v 'mqueue is empty' | wc -l)
-		    [ $rc -gt 1 ] && rc=1
+		    [ $rc_submit -gt 1 ] && rc=1
 		fi;;
 	    esac
 	fi;;
--- 440.status-mailq.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



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