INN commit: branches/2.5 (7 files)

INN Commit rra at isc.org
Wed Sep 24 18:05:04 UTC 2014


    Date: Wednesday, September 24, 2014 @ 11:05:04
  Author: iulius
Revision: 9726

innwatch:  add -i flag to specify how many seconds to sleep at startup

- Also fix previous commit [9651] that did not totally fix the issue it
was supposed to fix.

- Fix the behaviour of the -f flag (it wasn't doing anything).

- Fix how the -l flag was parsed (a space was required between -l and
its argument, whils it should not have been required).

- Add new POD documentation for innwatch, and update it at the same time:
document new -i flag, and document already existing -f flag.

Added:
  branches/2.5/doc/pod/innwatch.pod
    (from rev 9722, trunk/doc/pod/innwatch.pod)
Modified:
  branches/2.5/MANIFEST
  branches/2.5/doc/man/	(properties)
  branches/2.5/doc/pod/Makefile
  branches/2.5/doc/pod/news.pod
  branches/2.5/scripts/innwatch.in
Deleted:
  branches/2.5/doc/man/innwatch.8

----------------------+
 MANIFEST             |    1 
 doc/man/innwatch.8   |   59 --------------------------------------------
 doc/pod/Makefile     |    3 +-
 doc/pod/innwatch.pod |   65 +++++++++++++++++++++++++++++++++++++++++++++++++
 doc/pod/news.pod     |    5 +++
 scripts/innwatch.in  |   28 +++++++++++++++------
 6 files changed, 94 insertions(+), 67 deletions(-)

Modified: MANIFEST
===================================================================
--- MANIFEST	2014-09-24 18:01:11 UTC (rev 9725)
+++ MANIFEST	2014-09-24 18:05:04 UTC (rev 9726)
@@ -276,6 +276,7 @@
 doc/pod/innfeed.pod                   Master file for innfeed.8
 doc/pod/innmail.pod                   Master file for innmail.1
 doc/pod/innupgrade.pod                Master file for innupgrade.8
+doc/pod/innwatch.pod                  Master file for innwatch.8
 doc/pod/innxmit.pod                   Master file for innxmit.8
 doc/pod/install.pod                   Master file for INSTALL
 doc/pod/libauth.pod                   Master file for libauth.3


Property changes on: branches/2.5/doc/man
___________________________________________________________________
Modified: svn:ignore
   - active.5
active.times.5
actsync.8
archive.8
auth_krb5.8
batcher.8
buffchan.8
buffindexed.conf.5
ckpasswd.8
cnfsheadconf.8
cnfsstat.8
control.ctl.5
controlchan.8
convdate.1
ctlinnd.8
cvtbatch.8
cycbuff.conf.5
distrib.pats.5
distributions.5
docheckgroups.8
domain.8
expire.ctl.5
expire.8
expireover.8
expirerm.8
fastrm.1
getlist.1
grephistory.1
ident.8
incoming.conf.5
inews.1
inn-radius.conf.5
inn.conf.5
INN__Config.3pm
INN__Utils__Shlock.3pm
innbind.8
inncheck.8
innconfval.1
innd.8
inndf.8
innfeed.conf.5
innfeed.8
innmail.1
innupgrade.8
innxmit.8
libauth.3
libinnhist.3
libstorage.3
list.3
mailpost.8
makedbz.8
makehistory.8
mod-active.8
moderators.5
motd.news.5
newsfeeds.5
news.daily.8
news2mail.8
newslog.5
newsgroups.5
ninpaths.8
nnrpd.8
nntpsend.8
nntpsend.ctl.5
ovdb.5
ovdb_init.8
ovdb_monitor.8
ovdb_server.8
ovdb_stat.8
overchan.8
passwd.nntp.5
perl-nocem.8
pgpverify.1
procbatch.8
prunehistory.8
pullnews.1
qio.3
radius.8
rc.news.8
readers.conf.5
rnews.1
sasl.conf.5
scanlogs.8
scanspool.8
send-uucp.8
sendinpaths.8
shlock.1
simpleftp.1
sm.1
storage.conf.5
subscriptions.5
tally.control.8
tdx-util.8
tinyleaf.8
tst.3
uwildmat.3

   + active.5
active.times.5
actsync.8
archive.8
auth_krb5.8
batcher.8
buffchan.8
buffindexed.conf.5
ckpasswd.8
cnfsheadconf.8
cnfsstat.8
control.ctl.5
controlchan.8
convdate.1
ctlinnd.8
cvtbatch.8
cycbuff.conf.5
distrib.pats.5
distributions.5
docheckgroups.8
domain.8
expire.ctl.5
expire.8
expireover.8
expirerm.8
fastrm.1
getlist.1
grephistory.1
ident.8
incoming.conf.5
inews.1
inn-radius.conf.5
inn.conf.5
INN__Config.3pm
INN__Utils__Shlock.3pm
innbind.8
inncheck.8
innconfval.1
innd.8
inndf.8
innfeed.conf.5
innfeed.8
innmail.1
innupgrade.8
innwatch.8
innxmit.8
libauth.3
libinnhist.3
libstorage.3
list.3
mailpost.8
makedbz.8
makehistory.8
mod-active.8
moderators.5
motd.news.5
newsfeeds.5
news.daily.8
news2mail.8
newslog.5
newsgroups.5
ninpaths.8
nnrpd.8
nntpsend.8
nntpsend.ctl.5
ovdb.5
ovdb_init.8
ovdb_monitor.8
ovdb_server.8
ovdb_stat.8
overchan.8
passwd.nntp.5
perl-nocem.8
pgpverify.1
procbatch.8
prunehistory.8
pullnews.1
qio.3
radius.8
rc.news.8
readers.conf.5
rnews.1
sasl.conf.5
scanlogs.8
scanspool.8
send-uucp.8
sendinpaths.8
shlock.1
simpleftp.1
sm.1
storage.conf.5
subscriptions.5
tally.control.8
tdx-util.8
tinyleaf.8
tst.3
uwildmat.3


Deleted: doc/man/innwatch.8
===================================================================
--- doc/man/innwatch.8	2014-09-24 18:01:11 UTC (rev 9725)
+++ doc/man/innwatch.8	2014-09-24 18:05:04 UTC (rev 9726)
@@ -1,59 +0,0 @@
-.TH INNWATCH 8
-.SH NAME
-innwatch \- monitor innd.
-.SH SYNOPSIS
-.B innwatch 
-[ 
-.BI -l " logfile"
-]
-[
-.BI -t " seconds"
-]
-.SH DESCRIPTION
-.I Innwatch
-is normally started by
-.IR rc.news .
-It periodically \(em every
-.I <innwatchsleeptime in inn.conf>
-seconds \(em examines the load average, and the number of free blocks
-and inodes on the spool partition, as described by its
-control file,
-.IR innwatch.ctl .
-.PP
-If the load gets too high, or the disk gets too full, it throttles the server.
-When the condition restores, it unblocks the server.
-In addition, on each pass through the loop it will check the
-logfile
-.I <pathlog in inn.conf>/news.crit
-to see if it has been modified, and send mail to the news administrator
-if so.
-.PP
-Upon receipt of an interrupt signal (SIGINT),
-.IR innwatch
-will report its status in the file
-.IR <pathrun\ in\ inn.conf>/innwatch.status .
-.SH OPTIONS
-.TP
-.B \-l logfile
-To specify a log file to watch, other than the default of 
-.IR news.crit ,
-use the ``\fB\-l\fP'' flag.
-.TP
-.B \-t seconds
-To change the period between checks from the default from
-.I inn.conf ,
-use the ``\fB\-t\fP''
-flag.
-.SH HISTORY
-Written by Mike Cooper <mcooper at usc.edu>, with modifications by
-<kre at munnari.oz.au>,  Steve Groom <stevo at elroy.Jpl.Nasa.Gov> and
-Christophe Wolfhugel <wolf at pasteur.fr>.
-.de R$
-This is revision \\$3, dated \\$4.
-..
-.R$ $Id$
-.SH "SEE ALSO"
-ctlinnd(8), 
-inn.conf(5),
-innwatch.ctl(5),
-shlock(1).

Modified: doc/pod/Makefile
===================================================================
--- doc/pod/Makefile	2014-09-24 18:01:11 UTC (rev 9725)
+++ doc/pod/Makefile	2014-09-24 18:05:04 UTC (rev 9726)
@@ -35,7 +35,7 @@
 	../man/domain.8 ../man/expire.8 ../man/expireover.8 \
 	../man/expirerm.8 ../man/ident.8 \
 	../man/innbind.8 ../man/inncheck.8 ../man/innd.8 ../man/inndf.8 \
-	../man/innfeed.8 ../man/innupgrade.8 \
+	../man/innfeed.8 ../man/innupgrade.8 ../man/innwatch.8 \
 	../man/innxmit.8 \
 	../man/makedbz.8 ../man/makehistory.8 ../man/mod-active.8 \
 	../man/news.daily.8 ../man/news2mail.8 ../man/ninpaths.8 \
@@ -134,6 +134,7 @@
 ../man/inndf.8:		inndf.pod		; $(POD2MAN) -s 8 $? > $@
 ../man/innfeed.8:	innfeed.pod		; $(POD2MAN) -s 8 $? > $@
 ../man/innupgrade.8:	innupgrade.pod		; $(POD2MAN) -s 8 $? > $@
+../man/innwatch.8:	innwatch.pod		; $(POD2MAN) -s 8 $? > $@
 ../man/innxmit.8:	innxmit.pod		; $(POD2MAN) -s 8 $? > $@
 ../man/makedbz.8:	makedbz.pod		; $(POD2MAN) -s 8 $? > $@
 ../man/makehistory.8:	makehistory.pod		; $(POD2MAN) -s 8 $? > $@

Copied: branches/2.5/doc/pod/innwatch.pod (from rev 9722, trunk/doc/pod/innwatch.pod)
===================================================================
--- doc/pod/innwatch.pod	                        (rev 0)
+++ doc/pod/innwatch.pod	2014-09-24 18:05:04 UTC (rev 9726)
@@ -0,0 +1,65 @@
+=head1 NAME
+
+innwatch - Monitor the state of INN and the system
+
+=head1 SYNOPSIS
+
+B<innwatch> [B<-f> I<ctlfile>] [B<-i> I<seconds>] [B<-l> I<logfile>]
+[B<-t> I<seconds>]
+
+=head1 DESCRIPTION
+
+B<innwatch> is normally started by B<rc.news>.  Every
+I<innwatchsleeptime> seconds, as set in F<inn.conf>, it examines the load
+average, and the number of free blocks and inodes on the spool partition,
+as described by its control file, F<innwatch.ctl> in I<pathetc>.
+
+If the load gets too high, or the disk gets too full, it throttles
+the server.  When the condition restores, it unblocks the server.
+In addition, on each pass through the loop, it will check the logfile
+I<pathlog>/news.crit to see if it has been modified, and send mail to
+the news administrator if so.
+
+Upon receipt of an interrupt signal (SIGINT), B<innwatch> will report
+its status in the file F<innwatch.status> in I<pathrun>.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-f> I<file>
+
+Specify the control file to use, other than the default of
+F<innwatch.ctl> in I<pathetc>.
+
+=item B<-i> I<seconds>
+
+With this option, B<innwatch> has an initial sleep of I<seconds>
+seconds at startup.  This is useful when B<innwatch> is started at
+the same time as INN, so that it can wait a little before beginning
+performing its checks.
+
+=item B<-l> I<logfile>
+
+Specify a log file to watch, other than the default of F<news.crit>.
+
+=item B<-t> I<seconds>
+
+Specify the period in seconds between checks, to override the value
+set in F<inn.conf>.
+
+=back
+
+=head1 HISTORY
+
+Written by Mike Cooper <mcooper at usc.edu>, with modifications by
+<kre at munnari.oz.au>, Steve Groom <stevo at elroy.jpl.nasa.gov> and
+Christophe Wolfhugel <wolf at pasteur.fr>.  Converted to POD by Julien Elie.
+
+$Id$
+
+=head1 SEE ALSO
+
+inn.conf(5), innwatch.ctl(5), newslog(5), rc.news(8).
+
+=cut

Modified: doc/pod/news.pod
===================================================================
--- doc/pod/news.pod	2014-09-24 18:01:11 UTC (rev 9725)
+++ doc/pod/news.pod	2014-09-24 18:05:04 UTC (rev 9726)
@@ -13,6 +13,11 @@
 
 =item *
 
+Add new B<-f> flag to C<innwatch> to specify the configuration file to 
+use, in case it is not the default F<innwatch.ctl> file.
+
+=item *
+
 Fixed how B<innupgrade> is executed during an update of an INN
 installation; on a few systems like AIX, it fails to run because its
 taint mode was unproperly declared.

Modified: scripts/innwatch.in
===================================================================
--- scripts/innwatch.in	2014-09-24 18:01:11 UTC (rev 9725)
+++ scripts/innwatch.in	2014-09-24 18:05:04 UTC (rev 9726)
@@ -17,6 +17,9 @@
 PROGNAME=innwatch
 LOCK=${LOCKS}/LOCK.${PROGNAME}
 DAILY=${LOCKS}/LOCK.news.daily
+INNWATCHINITIALSLEEPTIME=1
+CHILDPID=
+
 ##  Where to put the timestamp file (directory and filename).
 TIMESTAMP=${LOCKS}/${PROGNAME}.time
 
@@ -37,18 +40,25 @@
 while [ $# -gt 0 ] ; do
     case X"$1" in
     X-f)
-	FILE=$2
+	CTLWATCH=$2
 	shift
 	;;
     X-f*)
-	FILE=`expr "$1" : '-s\(.*\)'`
+	CTLWATCH=`expr "$1" : '-f\(.*\)'`
 	;;
+    X-i)
+        INNWATCHINITIALSLEEPTIME=$2
+        shift
+        ;;
+    X-i*)
+        INNWATCHINITIALSLEEPTIME=`expr "$1" : '-i\(.*\)'`
+        ;;
     X-l)
 	LOGFILE=$2
 	shift
 	;;
     X-l*)
-	LOGFILE=`expr "$1" : '-s\(.*\)'`
+	LOGFILE=`expr "$1" : '-l\(.*\)'`
 	;;
     X-t)
 	INNWATCHSLEEPTIME=$2
@@ -74,7 +84,7 @@
 
 ##  Process arguments.
 if [ $# -ne 0 ] ; then
-    echo "Usage:  ${PROGNAME} [flags]" 1>&2
+    echo "Usage:  ${PROGNAME} [-f ctlfile] [-i seconds] [-l logfile] [-t seconds]" 1>&2
     exit 1
 fi
 
@@ -86,7 +96,7 @@
     exit 0
 }
 
-trap 'rm -f ${LOCK} ${WATCHPID} ; exit 1' 1 3 15
+trap 'rm -f ${LOCK} ${WATCHPID} ; test -n "${CHILDPID}" && kill ${CHILDPID} ; exit 1' 1 3 15
 echo "$$" > ${WATCHPID}
 
 ##  The reason why we turned innd off, and its, and our current state.
@@ -102,7 +112,9 @@
 ##  We need to remember the process ID of innd, in case one exits.
 ##  But we need to wait for innd to start before we can do that.
 while PID=`cat ${SERVERPID} 2>/dev/null`; test -z "${PID}"; do
-    sleep ${INNWATCHSLEEPTIME}
+    sleep ${INNWATCHINITIALSLEEPTIME} & CHILDPID=$!
+    wait
+    CHILDPID=
 done
 
 trap '(
@@ -126,8 +138,10 @@
 NEXTSLEEP=1
 HASEXITED=false
 
-while sleep ${NEXTSLEEP}
+while { sleep ${NEXTSLEEP} & CHILDPID=$! ; }
 do
+    wait
+    CHILDPID=
     NEXTSLEEP=${INNWATCHSLEEPTIME}
 
     ##  If news.daily is running, idle:  we don't want to change the



More information about the inn-committers mailing list