Path: utzoo!utstat!helios.physics.utoronto.ca!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!apple!ginger.acc.com!anise!pst From: pst@anise.acc.com (Paul Traina) Newsgroups: news.software.b Subject: Re: Cnews remote execution Message-ID: <1989Dec7.165459.1990@ginger.acc.com> Date: 7 Dec 89 16:54:59 GMT References: <4719@sater.cs.vu.nl> <1989Dec6.165959.985@utzoo.uucp> <89Dec7.102844est.2236@neat.cs.toronto.edu> Sender: news@ginger.acc.com (USENET news) Organization: Advanced Computer Communications, Santa Barbara, California Lines: 69 lamy@ai.utoronto.ca (Jean-Francois Lamy) writes: >We are exactly in that position here (the news partition is mounted by 140 >machines in 7 (closely knit but independent) subdomains. The following script >is what we use as both the "inews" invoked by the NNTP server and as the >script invoked by a "feednews" mail alias. The inews on the clients is the >NNTP inews (modified to make sure that a Path: header is added if missing). >All postings actually take place on the news server and the script tries >to handle moderated newsgroups properly wrt return addresses and the like. [ post of server.inews deleted ] The version Jean-Francois's server inews that I had been using (*not* necessarily what he just posted) had some problems and shortcomings that were really difficult to deal with (among other things, I use Erik Fair's gateway software). Finally I gave up and looked to see what had to be done to get the normal inews to work properly. I replaced his server.inews with the following script: #!/bin/sh # server_inews - set some things so C inews doesn't mess up with ttys et al. # =()<. ${NEWSCONFIG-@@}>()= . ${NEWSCONFIG-/usr/lib/news/bin/config} HOME=$NEWSCTL LOGNAME=news NAME="USENET news" export HOME LOGNAME NAME exec $NEWSBIN/inject/inews -W $* This script will call the normal Cnews inews program -- it will support all of the command line options that inews handles. By setting LOGNAME, NAME, and HOME, we manage to avoid all of inews' crufty interactive checks (which assume that the executor of inews is a person and is on a tty). This script has been in heavy use for over 3 months. I discussed some other things with Geoff and he has made the following changes to inews so it will accurately return message status. The changes to inews are not necessary, but I feel they should be made for better error reporting. The next version of inews will have these modifications built in. (Right Geoff?) Change the "waitcmd=''" line at the start of inews to: waitcmd='status=0' Modify the -W) flag processing line to read: -W) waitcmd='wait; status=$?' ;; # wait for completion And make sure the end of your inews script looks like this: . . . esac exit $status # trap 0 may cleanup, make dead.article ) & eval $waitcmd # wait & get status if -W given trap 0 # let the background run on unmolested exit $status This will insure that inews will exit with the proper error conditions instead of always exiting with a return condition of 0. -- "I don't know that atheists should be considered citizens, nor should they be considered patriots. This is one nation under God." -- George Bush "The government of the United States is not, in any sense, founded on the Christian religion." -- George Washington