🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #1095

Re: nntp files

#1095
From: Neil Rickert
Date: Sun, 31 Mar 1991 23:03
62 lines
2566 bytes
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>@}>()=
 ${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               <rickert@cs.niu.edu>
  Northern Illinois Univ.
  DeKalb, IL 60115                                   +1-815-753-6940
Technical Details
Message-ID: <1991Mar31.230358.16771@mp.cs.niu.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!linac!mp.cs.niu.edu!rickert
References: <1991Mar31.214919.17956@ssd.kodak.com>

Show Full Headers
Complete Article Headers
Message-ID: <1991Mar31.230358.16771@mp.cs.niu.edu>
Subject: Re: nntp files
Date: Sun, 31 Mar 1991 23:03:58 +0000
From: rickert@mp.cs.niu.edu (Neil Rickert)
References: <1991Mar31.214919.17956@ssd.kodak.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!linac!mp.cs.niu.edu!rickert
Newsgroups: news.software.b,news.software.nntp
Distribution: na
Organization: Northern Illinois University
Lines: 61