From owner-freebsd-bugs@FreeBSD.ORG Fri Feb 17 11:10:11 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8CEBB16A420 for ; Fri, 17 Feb 2006 11:10:11 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0951F43D46 for ; Fri, 17 Feb 2006 11:10:11 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k1HBAAWo011903 for ; Fri, 17 Feb 2006 11:10:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k1HBAA8k011902; Fri, 17 Feb 2006 11:10:10 GMT (envelope-from gnats) Resent-Date: Fri, 17 Feb 2006 11:10:10 GMT Resent-Message-Id: <200602171110.k1HBAA8k011902@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Petr Rehor Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9193116A420; Fri, 17 Feb 2006 11:05:35 +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 3746643D46; Fri, 17 Feb 2006 11:05:33 +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 k1HB5V6G036250; Fri, 17 Feb 2006 12:05:31 +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 k1HB5VHc036249; Fri, 17 Feb 2006 12:05:31 +0100 (CET) (envelope-from reho) Message-Id: <200602171105.k1HB5VHc036249@charon.rx.cz> Date: Fri, 17 Feb 2006 12:05:31 +0100 (CET) From: Petr Rehor To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: matteo@FreeBSD.org Subject: conf/93472: [patch] /etc/periodic/daily/440.status-mailq exits with bad value when daily_status_mailq_shorten is set to YES X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Petr Rehor List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2006 11:10:11 -0000 >Number: 93472 >Category: conf >Synopsis: [patch] /etc/periodic/daily/440.status-mailq exits with bad value when daily_status_mailq_shorten is set to YES >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: Fri Feb 17 11:10:10 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 wits 0 when daily_status_mailq_shorten is set to YES and you have two mails with same recipient in mail queue. >How-To-Repeat: Put exactly two mails with same recipient to mail queue, set daily_status_mailq_shorten="YES" in your /etc/periodic.conf and run /etc/periodic/daily/440.status-mailq; echo $? It prints one about items in mail queue line to terminal but exits with 0. >Fix: --- 440.status-mailq.diff begins here --- Index: 440.status-mailq =================================================================== RCS file: /home/ncvs/src/etc/periodic/daily/440.status-mailq,v retrieving revision 1.10 diff -u -r1.10 440.status-mailq --- 440.status-mailq 7 Feb 2006 08:21:06 -0000 1.10 +++ 440.status-mailq 17 Feb 2006 10:54:13 -0000 @@ -32,8 +32,9 @@ awk '$1 > 1 {print $1, $2}';; *) mailq;; - esac | tee /dev/stderr | fgrep -v 'mqueue is empty' | wc -l) - [ $rc -gt 1 ] && rc=1 || rc=0 + esac | tee /dev/stderr | + egrep -v '(mqueue is empty|Total requests)' | wc -l) + [ $rc -gt 0 ] && rc=1 || rc=0 case "$daily_status_include_submit_mailq" in [Yy][Ee][Ss]) @@ -52,8 +53,9 @@ awk '$1 > 1 {print $1, $2}';; *) mailq -Ac;; - esac | tee /dev/stderr | fgrep -v 'mqueue is empty' | wc -l) - [ $rc_submit -gt 1 ] && rc=1 + esac | tee /dev/stderr | + egrep -v '(mqueue is empty|Total requests)' | wc -l) + [ $rc_submit -gt 0 ] && rc=1 fi;; esac fi;; --- 440.status-mailq.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: