INN commit: trunk (doc/pod/news.daily.pod scripts/news.daily.in)

INN Commit Russ_Allbery at isc.org
Fri May 8 09:07:58 UTC 2009


    Date: Friday, May 8, 2009 @ 02:07:57
  Author: iulius
Revision: 8453

innfeed dropped files in its spool will now be processed
by news.daily, running procbatch; a "noprocbatch" keyword
has been added to disable this automatic process.

Modified:
  trunk/doc/pod/news.daily.pod
  trunk/scripts/news.daily.in

------------------------+
 doc/pod/news.daily.pod |   15 +++++++++++++--
 scripts/news.daily.in  |   38 +++++++++++++++++++++++++++++++++++++-
 2 files changed, 50 insertions(+), 3 deletions(-)

Modified: doc/pod/news.daily.pod
===================================================================
--- doc/pod/news.daily.pod	2009-05-08 08:45:04 UTC (rev 8452)
+++ doc/pod/news.daily.pod	2009-05-08 09:07:57 UTC (rev 8453)
@@ -7,8 +7,8 @@
 B<news.daily> [B<delayrm>] [B<expctl>=I<path>] [B<expdir>=I<path>]
 [B<expireover>] [B<expireoverflags>=I<args>] [B<flags>=I<args>]
 [B<lowmark>] [B<mailto>=I<address>] [B<noexpire>] [B<noexpireover>]
-[B<noexplog>] [B<nologs>] [B<nomail>] [B<norenumber>] [B<norm>]
-[B<norotate>] [B<nostat>] [B<notdaily>] [B<postexec>=I<program>]
+[B<noexplog>] [B<nologs>] [B<nomail>] [B<noprocbatch>] [B<norenumber>]
+[B<norm>] [B<norotate>] [B<nostat>] [B<notdaily>] [B<postexec>=I<program>]
 [B<tmpdir>=I<path>] [I</path/to/a/program>]
 
 =head1 DESCRIPTION
@@ -38,6 +38,10 @@
 
 =item *
 
+processing B<innfeed> dropped files with B<procbatch>;
+
+=item *
+
 renumbering the F<active> file with B<ctlinnd>;
 
 =item *
@@ -173,6 +177,13 @@
 their stdout and stderr redirected into a file.
 If the file is empty, no message is sent.
 
+=item B<noprocbatch>
+
+This keyword disables the run of B<procbatch> on B<innfeed> dropped files
+generated in its spool directory.  These files contain a list of articles
+which were not correctly sent to peers.  By default, they will be processed
+and removed afterwards.
+
 =item B<norenumber>
 
 This keyword disables the C<ctlinnd renumber> operation.  Normally, the low-water

Modified: scripts/news.daily.in
===================================================================
--- scripts/news.daily.in	2009-05-08 08:45:04 UTC (rev 8452)
+++ scripts/news.daily.in	2009-05-08 09:07:57 UTC (rev 8453)
@@ -17,6 +17,7 @@
 ##      noexplog             Do not log expire output
 ##      nologs               Do not scan log files
 ##      nomail               Do not capture and mail output
+##      noprocbatch          Do not run procbatch on innfeed dropped files
 ##      norenumber           Do not renumber the active file
 ##      norm                 Do not remove certain old files
 ##      norotate             Do not rotate logfiles
@@ -31,8 +32,12 @@
 HOSTNAME=`hostname`
 DATE=`date`
 TAGGEDHASH=${DO_DBZ_TAGGED_HASH}
-SORT=sort
 
+##  Try to find the path to innfeed's spool.  The default is
+##  ${PATHSPOOL}/innfeed if not found.
+INNFEEDSPOOL=`${AWK} '{gsub(/:|#/, " & ")} {if ($1 == "backlog-directory" && $2 == ":") print $3}' ${PATHETC}/innfeed.conf`
+test -z "${INNFEEDSPOOL}" && test -f "${PATHSPOOL}/innfeed" && INNFEEDSPOOL="innfeed"
+
 ##  If your expire does not pause or throttle innd, enable this next line:
 #MESSAGE="Expiration script $$"
 ##  Renumber all at once, or in steps?  Set to the delay if steps (that
@@ -49,6 +54,7 @@
 DOEXPIREOVER=false
 DOLOGS=true
 DOMAIL=true
+DOPROCBATCH=true
 DORENUMBER=true
 DORM=true
 DOSTAT=true
@@ -143,6 +149,9 @@
 	DOMAIL=false
 	MAIL="cut -c 1-1022 | ${SED} -e 's/^~/~~/'"
 	;;
+    Xnoprocbatch)
+        DOPROCBATCH=false
+        ;;
     Xnorenumber)
 	DORENUMBER=false
 	;;
@@ -215,6 +224,33 @@
     exec 3>&1 >${TEMP} 2>&1
 fi
 
+if [ "${DOPROCBATCH}" = "true" ] && [ -d "${PATHSPOOL}/${INNFEEDSPOOL}" ]
+then
+    cd "${PATHSPOOL}/${INNFEEDSPOOL}"
+
+    # Find the PIDs of innfeed.
+    LOCKS=`cat *.lock | ${SORT} -u`
+
+    # Process files like "innfeed-dropped.A001703" where
+    # 1703 is not in $LOCKS.
+    for file in `find -name "innfeed-dropped*"`
+    do
+        PID=`echo "$file" | ${SED} 's/^.*[A-Z]0*//'`
+        FOUND=false
+        for LOCK in $LOCKS
+        do
+            if [ "$PID" = "$LOCK" ]
+            then
+                FOUND=true
+            fi
+        done
+        if [ "$FOUND" = "false" ]
+        then
+            ${PATHBIN}/procbatch -qmu $file
+        fi
+    done
+fi
+
 cd ${PATHETC}
 
 ##  Show the status of the news system.




More information about the inn-committers mailing list