Newsgroups: news.software.b Path: utzoo!utgpu!jarvis.csri.toronto.edu!neat.ai.toronto.edu!lamy From: lamy@ai.utoronto.ca (Jean-Francois Lamy) Subject: Re: NNTP and C News Message-ID: <89Jul3.212503edt.10369@neat.ai.toronto.edu> References: Distribution: news Date: Mon, 3 Jul 89 21:24:51 EDT I did the context diffs for C news 1.5.5. I advise that you ignore the sources in the C news distribution, as they are for 1.5 (which Geoff is still running). The safest course of action is for you to get nntp 1.5.5 from neat.ai.toronto.edu (128.100.1.65) and to get the C news diffs from there as well. Unpack, unshar the shar file to create batch.c, and apply the diffs with patch. You will have a vanilla 1.5.5.C that you can customize for your site. The rest of the installation is exactly like 1.5.5. You should specify the location of the list of articles in your sys file to match what your nntpsend expects. If you want, you can use the enclosed nntpsend, which locks things "C news style" and does not rely on the file of article paths "cooling off" like nntpsend currently does. It also assumes that the lists of articles togo are under spool/out.going like the rest of C news batching does. I chose that over doing a "vianntp" batcher because I prefer running nntpsend independently. You can run as many of those nntpsends at the same time as you wish, they lock properly. I even had them running after each relaynews for an afternoon... I have also enclosed our sys file, should you need an example. Jean-Francois Lamy lamy@ai.utoronto.ca, uunet!ai.utoronto.ca!lamy AI Group, Department of Computer Science, University of Toronto, Canada M5S 1A4 ------------------------------------------------------------------------------- #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # If this archive is complete, you will see the following message at the end: # "End of shell archive." # # Contents: # nntpsend sys # # Wrapped by lamy@ai.utoronto.ca on Mon Jul 3 21:18:11 1989 # PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f nntpsend -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"nntpsend\" else echo shar: Extracting \"nntpsend\" \(2854 characters\) sed "s/^X//" >nntpsend <<'END_OF_nntpsend' X#!/bin/sh X# X# nntpsend site1 ... siten X# send nntp batches to remote sites, C news style. X# X# Author: Jean-Francois Lamy, lamy@ai.utoronto.ca, 1989-06-27 X# X# We assume that the file of articles to be sent is found under X# $NEWSARTS/out.going/iname/togo, where iname is the site's internet name. X# this may requre a $NEWSLIB/sys entry with an explicit location specified X# if the Usenet name differs, as in the last field of: X# X# utstat:comp,news,ut,tor,can,ont,uw,list/all:F:utstat.toronto.edu/togo X# X# A togo.next file in the site directory may contain articles left over from X# previous transmissions (we append togo to togo.next, call nntpxmit on X# togo.next and it leaves failed articles there). X X# =()<. ${NEWSCONFIG-@@}>()= X. ${NEWSCONFIG-/news/bin/config} X X# we assume $NEWSBIN/nntp is where nntpxmit lives; adjust appropriately XPATH=$NEWSBIN/nntp:$NEWSCTL/bin:$NEWSBIN/batch:$NEWSBIN:$NEWSPATH Xexport PATH Xumask $NEWSUMASK X Xpname=`basename $0` Xecho ${pname}: "[$$]" begin `date` X Xfor host in ${remotes=$*} Xdo X cd $NEWSARTS/out.going/$host X X if test -s togo || test -s togo.next X then X X # we have articles to send to $host. Lock the news system, so X # that we can be sure that "togo" does not change while we X # append it to the list of things to send out. If we don't do X # that, and relaynews is in a long batch, we could actually X # catch up with relaynews and then we would need some hairy X # stuff to deal with that. X X lock="$NEWSCTL/LOCK" # lock relaynews. X ltemp="$NEWSCTL/L.$$" X echo $$ >$ltemp X trap "rm -f $ltemp ; exit 0" 0 1 2 15 X while true X do X if newslock $ltemp $lock X then X trap "rm -f $ltemp $lock ; exit 0" 0 1 2 15 X break X fi X sleep 30 X done X X # while relaynews is locked, append the articles to go to X # the togo.next file for the current site. lock current site X # until nntpxmit completes, so we can unlock relaynews asap. X X nntplock="$NEWSCTL/LOCKnntpsend.$host" X if newslock $ltemp $nntplock X then X # we have togo.next all to ourselves X trap "rm -f $nntplock $ltemp $lock ; exit 0" 0 1 2 15 X if test -s togo.next X then X cat togo >> togo.next 2>/dev/null X rm -f togo X else X mv -f togo togo.next X fi X X # unlock news; the host's togo.next file is locked and X # won't be tampered with, so togo no longer matters. X rm -f $ltemp $lock X X # perform the actual transfers. X if test -s togo.next X then X echo ${pname}: "[$$]" begin ${host} X nntpxmit ${host}:togo.next X echo ${pname}: "[$$]" end ${host} X fi X X # unlock this site. X rm -f $nntpltemp $nntplock X else X # transfer in progress, leave articles to accumulate X # in ${host} for the time being. X echo ${pname}: "[$$]" ${host} locked by "[`cat $nntplock`]" X rm -f $ltemp $lock X fi # newslock LOCK$host.nntp X fi # test -s togo ... Xdone X Xecho ${pname}: "[$$]" end `date` END_OF_nntpsend if test 2854 -ne `wc -c sys <<'END_OF_sys' X# X# ourselves: accept everything X# Xjarvis.csri.toronto.edu:all X# X# upstream feeds X# X# NNTP X# (F flag suppresses article size; spool directory name is internet site name) Xmailrus:can,ont,gnu,inet,ddn,comp,news,sci,rec,misc,soc,talk,alt/world,na,usa,can,ont:F:mailrus.cc.umich.edu/togo Xrutgers:can,ont,gnu,inet,ddn,comp,news,sci,rec,misc,soc,talk,alt/world,na,usa,can,ont:F:rutgers.edu/togo X# X# downstream feeds X# X# NNTP X# (F flag suppresses article size; spool directory name is internet site name) Xutstat:comp,news,ut,tor,can,ont,uw,list/all:F:utstat.toronto.edu/togo Xubc-cs:can/all:F:cs.ubc.ca/togo X# UUCP Xdptcdc:can,ont,gnu,inet,ddn,comp,news,sci,rec,misc,soc,talk,alt/all:f: Xutgpu:all,!local,!ai,!general,!graf,!gradnews,!lisp,!tex,!test/all:f: X# mail batches Xme:all/all:f: Xqucis:all.all.ctl,alt.hypertext,can.jobs,comp.ai,comp.arch,comp.archives,comp.binaries.mac,comp.bugs.4bsd,comp.bugs.misc,comp.cog-eng,comp.compilers,comp.databases,comp.dcom,comp.doc,comp.editors,comp.emacs,comp.fonts,comp.graphics,comp.hypercube,comp.jobs,comp.lang.ada,comp.lang.c++,comp.lang.eiffel,comp.lang.misc,comp.lang.pascal,comp.lang.prolog,comp.lang.smalltalk,comp.laser-printers,comp.lsi,comp.newprod,comp.org.ieee,comp.os.cpm,comp.os.minix,comp.os.research,comp.parallel,comp.periphs,comp.protocol s,comp.simulation,comp.society.futures,comp.software-eng,comp.sources.mac,comp.sources.misc,comp.sources.sun,comp.sources.unix,comp.sources.wanted,comp.sources.x,comp.std.c,comp.std.internat,comp.std.misc,comp.sys.ibm.pc,comp.sys.mac,comp.sys.nsc.32k,comp.sys.sgi,comp.sys.sun,comp.sys.transputer,comp.sys.workstations,comp.text,comp.theory,comp.unix,comp.windows,control,gnu,misc.jobs.offered,news,sci.crypt,sci.psychology,sci.research,to.qucis/world,na,can,ont:f:qucis.queensu.ca/togo X# X# feeds into mailing lists X# Xut.ai:ut.ai/all::/news/bin/mailgateway ut-ai@ai Xcan.sun-stroke:can.sun-stroke/all::/news/bin/mailgateway sun-stroke@ai Xradha-news:list.nrcnet-l/all::/news/bin/mailgateway sanand@hub X#test-news:test/all::/news/bin/mailgateway lamy@ai X# X# distributed moderation X# X#digest-news:test,!test.ctl/all::/news/bin/stashtwimc X# X# testing X# X#utai:all/all:f: X#utcsri:all/all:f: X END_OF_sys if test 2172 -ne `wc -c