INN commit: trunk (3 files)

INN Commit rra at isc.org
Tue Feb 9 20:03:29 UTC 2010


    Date: Tuesday, February 9, 2010 @ 12:03:28
  Author: iulius
Revision: 8978

Add a new keyword to news.daily:  "procbatchdir" specifies the backlog
directories of innfeed when several instances of innfeed are running or
when its configuration file is not the default one.

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

------------------------+
 doc/pod/news.daily.pod |   10 +++++++-
 doc/pod/news.pod       |    6 ++++
 scripts/news.daily.in  |   58 +++++++++++++++++++++++++++++------------------
 3 files changed, 51 insertions(+), 23 deletions(-)

Modified: doc/pod/news.daily.pod
===================================================================
--- doc/pod/news.daily.pod	2010-02-09 19:03:38 UTC (rev 8977)
+++ doc/pod/news.daily.pod	2010-02-09 20:03:28 UTC (rev 8978)
@@ -9,7 +9,7 @@
 [B<lowmark>] [B<mailto>=I<address>] [B<noexpire>] [B<noexpireover>]
 [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>]
+[B<procbatchdir>=I<path>] [B<tmpdir>=I<path>] [I</path/to/a/program>]
 
 =head1 DESCRIPTION
 
@@ -221,6 +221,14 @@
 The program specified by the given path I<program> is executed just after all expiration
 is done.  Multiple programs may be specified; they will be invoked in order.
 
+=item B<procbatchdir>=I<path>
+
+B<news.daily> tries to find the backlog directory of B<innfeed> in
+F<innfeed.conf>.  In case several instances of B<innfeed> are running or
+when its configuration file is not the default one, the B<procbatchdir>
+keyword can be used to specify the path of the backlog directory.
+This keyword can be used more than once in the command-line.
+
 =item B<tmpdir>=I<path>
 
 Overrides the I<pathtmp> setting in F<inn.conf> by setting the environment variable

Modified: doc/pod/news.pod
===================================================================
--- doc/pod/news.pod	2010-02-09 19:03:38 UTC (rev 8977)
+++ doc/pod/news.pod	2010-02-09 20:03:28 UTC (rev 8978)
@@ -209,6 +209,12 @@
 
 =item *
 
+The B<procbatchdir> keyword has been added to B<news.daily> so as to specify
+the backlog directories of B<innfeed> when several instances of B<innfeed>
+are running or when its configuration file is not the default one.
+
+=item *
+
 A new feature has been added to B<sm>.  When the B<-c> flag is used,
 it shows a clear, decoded form of the storage API token.  This
 was previously done by the contrib B<showtoken> script developed

Modified: scripts/news.daily.in
===================================================================
--- scripts/news.daily.in	2010-02-09 19:03:38 UTC (rev 8977)
+++ scripts/news.daily.in	2010-02-09 20:03:28 UTC (rev 8978)
@@ -24,19 +24,24 @@
 ##      nostat               Do not run innstat
 ##      notdaily             Not a daily run, and therefore implies nologs
 ##      postexec=xxx         Path to a program to run after expiring
+##      procbatchdir=xxx     Directory in which to run procbatch
 ##      tmpdir=xxx           Working directory for `sort' and such
 ##      /full/path           Path to a program to run before expiring
 
 EXPLOG=${MOST_LOGS}/expire.log
 INNSTAT=${PATHBIN}/innstat
+INNFEEDCONF=${PATHETC}/innfeed.conf
 HOSTNAME=`hostname`
 DATE=`date`
 TAGGEDHASH=${DO_DBZ_TAGGED_HASH}
 
 ##  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 [ -f ${INNFEEDCONF} ]; then
+    INNFEEDSPOOL=`${AWK} '{gsub(/:|#/, " & ")} {if ($1 == "backlog-directory" && $2 == ":") print $3}' ${INNFEEDCONF}`
+fi
+test -z "${INNFEEDSPOOL}" && test -d "${PATHSPOOL}/innfeed" && INNFEEDSPOOL="innfeed"
+PROCBATCHDIR="${PATHSPOOL}/${INNFEEDSPOOL}"
 
 ##  If your expire does not pause or throttle innd, enable this next line:
 #MESSAGE="Expiration script $$"
@@ -109,6 +114,9 @@
     Xexpdir=*)
 	EXPDIR=`expr "${I}" : 'expdir=\(.*\)'`
 	;;
+    Xprocbatchdir=*)
+        PROCBATCHDIR="${PROCBATCHDIR} `expr "${I}" : 'procbatchdir=\(.*\)'`"
+        ;;
     Xtmpdir=*)
 	TMPDIR=`expr "${I}" : 'tmpdir=\(.*\)'`
 	;;
@@ -231,29 +239,35 @@
     exec 3>&1 >${TEMP} 2>&1
 fi
 
-if [ "${DOPROCBATCH}" = "true" ] && [ -d "${PATHSPOOL}/${INNFEEDSPOOL}" ]
+if [ "${DOPROCBATCH}" = "true" ]
 then
-    cd "${PATHSPOOL}/${INNFEEDSPOOL}"
+    for DIRECTORY in ${PROCBATCHDIR}
+    do
+        if [ -d "${DIRECTORY}" ]
+        then
+            cd "${DIRECTORY}"
 
-    # Find the PIDs of innfeed.
-    INNFEEDLOCKS=`cat *.lock 2>/dev/null | ${SORT} -u`
+            # Find the PIDs of innfeed.
+            INNFEEDLOCKS=`cat *.lock 2>/dev/null | ${SORT} -u`
 
-    # Process files like "innfeed-dropped.A001703" where
-    # 1703 is not in $INNFEEDLOCKS.
-    for file in `find . -name "innfeed-dropped*" -print`
-    do
-        PID=`echo "$file" | ${SED} 's/^.*[A-Z]0*//'`
-        FOUND=false
-        for INNFEEDLOCK in $INNFEEDLOCKS
-        do
-            if [ "$PID" = "$INNFEEDLOCK" ]
-            then
-                FOUND=true
-            fi
-        done
-        if [ "$FOUND" = "false" ]
-        then
-            ${PATHBIN}/procbatch -qmu $file
+            # Process files like "innfeed-dropped.A001703" where
+            # 1703 is not in $INNFEEDLOCKS.
+            for file in `find . -name "innfeed-dropped*" -print`
+            do
+                PID=`echo "$file" | ${SED} 's/^.*[A-Z]0*//'`
+                FOUND=false
+                for INNFEEDLOCK in $INNFEEDLOCKS
+                do
+                    if [ "$PID" = "$INNFEEDLOCK" ]
+                    then
+                        FOUND=true
+                    fi
+                done
+                if [ "$FOUND" = "false" ]
+                then
+                    ${PATHBIN}/procbatch -qmu $file
+                fi
+            done
         fi
     done
 fi




More information about the inn-committers mailing list