From reho@rx.cz  Wed Jan 25 09:51:22 2006
Return-Path: <reho@rx.cz>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A053116A41F;
	Wed, 25 Jan 2006 09:51:22 +0000 (GMT)
	(envelope-from reho@rx.cz)
Received: from charon.rx.cz (199.106.broadband4.iol.cz [85.71.106.199])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C9A2943D48;
	Wed, 25 Jan 2006 09:51:21 +0000 (GMT)
	(envelope-from reho@rx.cz)
Received: from charon.rx.cz (localhost [127.0.0.1])
	by charon.rx.cz (8.13.4/8.13.4) with ESMTP id k0P9pEW8013055;
	Wed, 25 Jan 2006 10:51:19 +0100 (CET)
	(envelope-from reho@199.106.broadband4.iol.cz)
Received: (from root@localhost)
	by charon.rx.cz (8.13.4/8.13.4/Submit) id k0P9kZf8013013;
	Wed, 25 Jan 2006 10:46:35 +0100 (CET)
	(envelope-from reho)
Message-Id: <200601250946.k0P9kZf8013013@charon.rx.cz>
Date: Wed, 25 Jan 2006 10:46:35 +0100 (CET)
From: Petr Rehor <prehor@gmail.com>
Reply-To: Petr Rehor <prehor@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc: gshapiro@freebsd.org
Subject: [patch] /etc/periodic/daily/440.status-mailq exits with 1 even if mail queues are empty.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>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:    matteo
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 25 10:00:19 GMT 2006
>Closed-Date:    Sun Mar 12 18:46:00 GMT 2006
>Last-Modified:  Sun Mar 12 18:46:00 GMT 2006
>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:
State-Changed-From-To: open->closed 
State-Changed-By: matteo 
State-Changed-When: Sun Jan 29 18:30:42 UTC 2006 
State-Changed-Why:  
Take this as I'm interested 

http://www.freebsd.org/cgi/query-pr.cgi?pr=92299 
State-Changed-From-To: closed->open 
State-Changed-By: matteo 
State-Changed-When: Sun Feb 5 20:38:23 UTC 2006 
State-Changed-Why:  
I said I would take it, not close it 


Responsible-Changed-From-To: freebsd-bugs->matteo 
Responsible-Changed-By: matteo 
Responsible-Changed-When: Sun Feb 5 20:38:23 UTC 2006 
Responsible-Changed-Why:  
Take this as I'm interested 

http://www.freebsd.org/cgi/query-pr.cgi?pr=92299 
State-Changed-From-To: open->patched 
State-Changed-By: matteo 
State-Changed-When: Tue Feb 7 08:23:01 UTC 2006 
State-Changed-Why:  
Fixed in HEAD. Will MFC it soon 

http://www.freebsd.org/cgi/query-pr.cgi?pr=92299 
State-Changed-From-To: patched->closed 
State-Changed-By: matteo 
State-Changed-When: Sun Mar 12 18:45:41 UTC 2006 
State-Changed-Why:  
Fixed, thanks 

http://www.freebsd.org/cgi/query-pr.cgi?pr=92299 
>Unformatted:
