Xref: utzoo news.software.b:7312 news.software.nntp:1233 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!linac!mp.cs.niu.edu!rickert From: rickert@mp.cs.niu.edu (Neil Rickert) Newsgroups: news.software.b,news.software.nntp Subject: Re: nntp files Message-ID: <1991Mar31.230358.16771@mp.cs.niu.edu> Date: 31 Mar 91 23:03:58 GMT References: <1991Mar31.214919.17956@ssd.kodak.com> Distribution: na Organization: Northern Illinois University Lines: 61 In article <1991Mar31.214919.17956@ssd.kodak.com> dcox@ssd.kodak.com (Don Cox (253-7121)) writes: >Every now and then I get an nntp buildup, such as: > >-rw-r--r-- 1 root 17073 Mar 31 01:23 nntp.a01263 >-rw-r--r-- 1 root 37712 Mar 31 01:23 nntp.a01634 >... This is caused when nntpd terminates prematurely, without properly renaming the file. It is sometime caused by short term network outages. Instead of periodically running 'newsrun' from 'crontab', I am running the following script which itself eventually invokes newsrun. It is run as 'news', whereas nntpd runs as root. -------------- Begin ------------------- #! /bin/sh # Process spooled news. # =()<. ${NEWSCONFIG-@@}>()= . ${NEWSCONFIG-/usr/lib/news/bin/config} PATH=$NEWSCTL/bin:$NEWSBIN/input:$NEWSBIN/relay:$NEWSBIN:$NEWSPATH ; export PATH umask $NEWSUMASK hold="$1" here="$NEWSARTS/in.coming" cd $here # First, is it worth trying at all? if test -r stop then exit 0 fi # Convert any left-over 'nntp.' files. for file in `ls -rtd . nntp.*` do if [ "$file" = "." ] ; then break ; else true ; fi pid=`expr $file : 'nntp.\([0-9]*\)$'` numprocs=`ps \#$pid | wc -l` state="`/bin/kill -0 $pid`" case "$state" in *"No such process"*) ln $file 100$pid && rm -f $file ;; *) ;; esac done $NEWSBIN/input/newsrun $hold -------------- End ------------------- The script only touches nntp.* files older than the last directory modification date. It tests whether nntpd is still running with the 'kill -0'. You might want to check the message your system provides in this case, for use in the 'case' statement -- =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= Neil W. Rickert, Computer Science Northern Illinois Univ. DeKalb, IL 60115 +1-815-753-6940