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

INN Commit Russ_Allbery at isc.org
Thu Nov 20 15:41:13 UTC 2008


    Date: Thursday, November 20, 2008 @ 07:41:12
  Author: iulius
Revision: 8179

Unreserve the server only if it was reserved by expire.
Be sure to also do that in case news.daily exits.

Thanks to D. Stussy for having pointed this issue out.

Modified:
  trunk/scripts/news.daily.in

---------------+
 news.daily.in |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Modified: news.daily.in
===================================================================
--- news.daily.in	2008-11-20 15:23:49 UTC (rev 8178)
+++ news.daily.in	2008-11-20 15:41:12 UTC (rev 8179)
@@ -347,6 +347,10 @@
     if [ -n "${EXPDIR}" ] ; then
 	if [ ! -f ${EXPDIR}/history.n -o ! -f ${EXPDIR}/history.n.done ] ; then
 	    ( echo "$0: No new history files"; ${INNSTAT} ) | eval ${MAIL}
+            ##  Remove the possible reserve mode (in case expire was killed).
+            if (ctlinnd mode | grep "Reserved ${REASON}" > /dev/null) ; then
+                ctlinnd -s reserve "" 2>/dev/null
+            fi
 	    exit 1
 	fi
 	cp /dev/null ${HISTORY}
@@ -373,6 +377,10 @@
     if ${THROTTLED} || test -n "${MESSAGE}" ; then
 	ctlinnd -t "$TOUT" -s go "${MESSAGE}" 2>&1 || {
 	    ( echo "$0: Cannot unthrottle news"; ${INNSTAT} ) | eval ${MAIL}
+            ##  Remove the possible reserve mode (in case expire was killed).
+            if (ctlinnd mode | grep "Reserved ${REASON}" > /dev/null) ; then
+                ctlinnd -s reserve "" 2>/dev/null
+            fi
 	    exit 1
 	}
     fi
@@ -386,7 +394,9 @@
     find ${TEMPSOCKDIR} -name "${TEMPSOCK}" -mtime +2 -exec rm -f '{}' ';'
 
 ##  Remove the possible reserve mode (in case expire was killed).
-ctlinnd -s reserve "" 2>/dev/null
+if (ctlinnd mode | grep "Reserved ${REASON}" > /dev/null) ; then
+    ctlinnd -s reserve "" 2>/dev/null
+fi
 
 ##  Did we become throttled during the run?
 SERVERMODE=`ctlinnd mode 2>/dev/null | ${SED} 1q`




More information about the inn-committers mailing list