From domi@debussy.saargate.de  Fri Nov  4 12:30:20 2005
Return-Path: <domi@debussy.saargate.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E3F1816A420
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  4 Nov 2005 12:30:20 +0000 (GMT)
	(envelope-from domi@debussy.saargate.de)
Received: from jail.teresto.net (jail.teresto.net [212.88.134.36])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7708B43D45
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  4 Nov 2005 12:30:20 +0000 (GMT)
	(envelope-from domi@debussy.saargate.de)
Received: from dominik.saargate.de ([212.88.133.188] helo=debussy.saargate.de)
	by jail.teresto.net with esmtp (Exim 4.42 (FreeBSD))
	id 1EXzD4-000Hvn-Ht
	for FreeBSD-gnats-submit@freebsd.org; Fri, 04 Nov 2005 11:54:15 +0100
Received: from debussy.saargate.de (localhost [127.0.0.1])
	by debussy.saargate.de (8.13.3/8.13.3) with ESMTP id jA4As2K9000877
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 4 Nov 2005 11:54:02 +0100 (CET)
	(envelope-from domi@debussy.saargate.de)
Received: (from domi@localhost)
	by debussy.saargate.de (8.13.3/8.13.3/Submit) id jA4As2xu000876;
	Fri, 4 Nov 2005 11:54:02 +0100 (CET)
	(envelope-from domi)
Message-Id: <200511041054.jA4As2xu000876@debussy.saargate.de>
Date: Fri, 4 Nov 2005 11:54:02 +0100 (CET)
From: Dominik Brettnacher <domi@saargate.de>
Reply-To: Dominik Brettnacher <domi@saargate.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] make periodic(8) quiet (configurable) when no output was generated
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         88486
>Category:       bin
>Synopsis:       [patch] make periodic(8) quiet (configurable) when no output was generated
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dwmalone
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 04 12:40:12 GMT 2005
>Closed-Date:    Sun Jul 29 20:33:15 GMT 2007
>Last-Modified:  Sun Jul 29 20:33:15 GMT 2007
>Originator:     Dominik Brettnacher
>Release:        FreeBSD 5.4-RELEASE i386
>Organization:
>Environment:
System: FreeBSD debussy.saargate.de 5.4-RELEASE FreeBSD 5.4-RELEASE #4: Tue Aug 23 12:00:38 CEST 2005 domi@debussy.saargate.de:/usr/obj/usr/src/sys/DEBUSSY i386

>Description:

By default, periodic(8) outputs a notification like "No output from the x files processed" if the scripts executed did not generate any output. While this
is useful to know whether the scripts have been executed at all, notifications
like these are too verbose in certain environments.

The attached patch introduces a new option "<basedir>_show_empty_output"
to make this configurable. Setting it to YES (the default) results in the
known behaviour. Setting it to NO means that no output (and thus no mail, if
periodic output is sent out via mail) is generated.

>How-To-Repeat:
>Fix:
--- /usr/sbin/periodic	Thu Apr  3 10:55:30 2003
+++ periodic	Mon Oct 31 17:13:39 2005
@@ -40,11 +40,11 @@
     case "$output" in
     /*) pipe="cat >>$output";;
     "") pipe=cat;;
-    *)  pipe="mail -s '$host ${arg##*/} run output' $output";;
+    *)  pipe="mail -E -s '$host ${arg##*/} run output' $output";;
     esac
 
-    success=YES info=YES badconfig=NO	# Defaults when ${run}_* aren't YES/NO
-    for var in success info badconfig
+    success=YES info=YES badconfig=NO empty_output=YES	# Defaults when ${run}_* aren't YES/NO
+    for var in success info badconfig empty_output
     do
         case $(eval echo "\$${arg##*/}_show_$var") in
         [Yy][Ee][Ss]) eval $var=YES;;
@@ -95,8 +95,11 @@
         done
         if [ $empty = TRUE ]
         then
-          [ $processed = 1 ] && plural= || plural=s
-          echo "No output from the $processed file$plural processed"
+          if [ $empty_output = TRUE ]
+          then
+            [ $processed = 1 ] && plural= || plural=s
+            echo "No output from the $processed file$plural processed"
+          fi
         else
           echo ""
           echo "-- End of $arg output --"
>Release-Note:
>Audit-Trail:

From: Jo Rhett <jrhett@netconsonance.com>
To: bug-followup@FreeBSD.org, domi@saargate.de
Cc:  
Subject: Re: bin/88486: [patch] make periodic(8) quiet (configurable) when no output was generated
Date: Tue, 1 May 2007 13:05:02 -0700

 This is very useful and solves a very annoying problem.  And I say  
 "very" because it comes up on the mailing list every few weeks.  Is  
 there a reason that this patch hasn't been committed?
 
 -- 
 Jo Rhett
 Net Consonance : consonant endings by net philanthropy, open source  
 and other randomness
 
 

From: Jo Rhett <jrhett@svcolo.com>
To: bug-followup@FreeBSD.org, domi@saargate.de
Cc:  
Subject: Re: bin/88486: [patch] make periodic(8) quiet (configurable) when no output was generated
Date: Tue, 1 May 2007 13:10:14 -0700

 FWIW the attached patch applies cleanly against 6.2
 
 
 
 
Responsible-Changed-From-To: freebsd-bugs->brian 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed Jun 20 04:43:40 UTC 2007 
Responsible-Changed-Why:  
Brian has touched periodic a couple of times, maybe he wants to do 
this one too? 


http://www.freebsd.org/cgi/query-pr.cgi?pr=88486 
Responsible-Changed-From-To: brian->dwmalone 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Wed Jun 20 11:17:50 UTC 2007 
Responsible-Changed-Why:  
I'm just having a look at this - I've a patch that includes man page 
changes at: 

http://www.maths.tcd.ie/~dwmalone/periodic.patch 

David. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=88486 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/88486: commit references a PR
Date: Fri, 22 Jun 2007 10:04:13 +0000 (UTC)

 dwmalone    2007-06-22 10:04:06 UTC
 
   FreeBSD src repository
 
   Modified files:
     usr.sbin/periodic    periodic.8 periodic.sh 
   Log:
   Add an option to make periodic(8) quiet when no output was generated.
   
   The man page part of the patch is my fault, the changes to the
   periodic script is Dominik's.
   
   PR:             88486
   Submitted by:   Dominik Brettnacher <domi@saargate.de>
   Reviewed by:    brian
   Approved by:    re
   MFC after:      1 month
   
   Revision  Changes    Path
   1.31      +5 -0      src/usr.sbin/periodic/periodic.8
   1.21      +8 -5      src/usr.sbin/periodic/periodic.sh
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: dwmalone 
State-Changed-When: Sun Jul 29 20:32:29 UTC 2007 
State-Changed-Why:  
This feature has now been added to RELENG_6 and -current. Thanks 
for the patch! 

David. 

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