From: crash@ckctpa.UUCP (Frank "Crash" Edwards)
Subject: Re: Cnews?  Help!
Summary: some answers about the CNews' RNEWS program
Date: Mon, 28 Sep 1992 18:09:32 GMT
Reply-To: crash%ckctpa@tct.com (Frank "Crash" Edwards)
Organization: Edwards & Edwards Consulting

bobl@bobsbox.rent.com (Bob Lindabury - SysAdmin) writes:
>I got CNews from UUNET.  Ah..did I miss the archive?  I didn't see one
>below.

No, when I saw later in the article that you had fixed those two
scripts, DoBatch.e and DoBatch.e2, I didn't feel it was necessary to
shar them together -- sorry everybody about the confusion.  I didn't
back up and re-read my article so I didn't catch that little slip.
(This one I'll re-read before it goes out :-)  See the "PS" at the
bottom of this posting for details about docs and UnBatch scripts.

>                                                     Assuming the
>transport is AmigaUUCP and completing the scripts based on that premise
>would go a long way towards increasing the userbase of the CNews port.

This may be a reasonable assumption at this point, although back in
January of '91 it wasn't.

>Hopefully Mike will be reading this and will be able to shed some light
>on the subject.  Maybe allowing GRn to optionally read the active and
>history files would be advantagous for GRn.

See my response to Mike's response to my first response to your
questions.  ;-) ;-)  (Posted a few minutes ago.)

>Ok..maybe I'm missign something here.  Normally (as I understand it)
>when I post something with GRn, GRn calls postnews which then calls
>rnews which posts the article locally and queues it for batching
>which then calls batchnews (if set to autobatch) to batch it for the
>outgoing sites.  Batchnews then uses uux to queue it in the spool
>directory.

The CNews version of RNEWS _does_not_ post the article -- it merely
stores it in "NewsArts:in.coming" until the unbatcher runs.  The
UnBatch.e script(s) call RELAYNEWS who is responsible for actually
updating the ACTIVE and HISTORY files, et al.

The philosphy for this on the Unix side was to limit the unbatching
process so that it doesn't occur as a result of UUXQT, but to a time
that can be preset by the administrator via CRON or similar program.

>When I run CNews GRn calls postnews which then calls rnews (for CNews)
>which then does what?  Doesn't it post the article locally based on the
>sys file?
No.

>           If not, does it call relaynews to do this?
No.

>                                                       Unbatch doesn't
>recognize it because it's not compressed and it's not a batch.  It's
>just an article.

Right; my newsreader invoked REALYNEWS directly (see the CNews.Config
file for the command line) in order to post the article.  You have a
few possibilities to resolve this:

    1.	Change POSTNEWS to call RELAYNEWS instead (q.v. CNews.Config).
	This is viable 'cuz POSTNEWS is _always_ used on uncompressed
	batches, so they could be fed directly into RELAYNEWS with the
	appropriate command line options, and it gives instant
	recognition to the newsreader that the article was posted.

    2.	Change GRn to call RELAYNEWS.  Workable for the same reason as
	above, but I don't use GRn so I don't know how easy this would
	be to do.

    3.	Change UnBatch.e so that after doing all of the .Z files, it
	then does all other files in the directory that don't end in
	.Z.  Perhaps by moving them to a sub-directory first, so that
	if another article is posted while UnBatch.e is processing them
	it doesn't get too confused about what it's already done and
	what it hasn't.  This scenario won't update any of the CNews
	files (ie ACTIVE and HISTORY) until the unbatcher runs, so you
	won't be able to read your own articles until then.  The
	UnBatch scripts I'm posting in a.s.a.u.p are configured this
	way.

>newsarts:in.coming (dir):
>------rwed--------     2      643 25-Sep-92 14:16 464969760
>------rwed--------     4     1563 26-Sep-92 06:12 nspoolA.518008
>
>The files starting with the numbers are articles posted locally via GRn.
>They are not distributed to the appropriate newsgroups and I can't
>figure out how to do that.  I'm unsure as to what the nspool files are
>but they seem to be news articles that have arrived via mail and run
>through AmigaUUCP's postnews from the mail aliases.

They are temporary files created by RELAYNEWS during unbatching.  They
should be deleted when a given batch has finished processing.  If
there is no RELAYNEWS running on your system, then there shouldn't be
any nspool* files.  If there are, you've got a version of RELAYNEWS
that had a race condition in it that might cause the nspool* files to
not be deleted.  The easiest way to fix that is to modify your script
that calls RELAYNEWS (UnBatch.e is the typical one) to delete all
files with the name "nspool#?" in that directory when it completes.
(The newly posted version of UnBatch doesn't do this which allows you
to determine if you have an older version of RELAYNEWS.)

>I hope someone can point me to these scripts.  I am running under ROM
>2.04 and WB 2.1.

There are problem reports I've gotten that stem from changes in the
way AmigaUUCP processes incoming news traffic.

If you're going to upgrade to a newer version of AmigaUUCP *PLEASE*
read the docs for AmigaUUCP and find out how the package has changed
so that you'll know if it affects your CNews scripts.  For instance,
way back in the beginning UUXQT would execute RNEWS by giving it a
filename on the command line.  This was contrary to the way the Unix
UUXQT calls programs where the input file is fed via standard input.
Matt changed this per my request and it fixed a CNews problem as well
as a lot of similar problems with other remote execution programs I
was using at the time.  Things like that can change how and when
your scripts are going to be called or the environment they'll execute
in.  You need to know about them when you upgrade so you can make
changes if necessary.  (Hopefully, though, changes like that would be
accompanied by new CNews scripts so that the typical user doesn't
actually have to edit any scripts...)

>> Concerning the manually created batch_#?.z files:  yes, you must
>> provide the transport interface.  CNews _is not_ a transport, it's a
>> message handling package.  UUCP is a transport agent.  I would suggest
>> either adding a line to DoBatch.e to queue up the transfers at the end
>> of the batching or run a separate program to do it after DoBatch
>> finishes.
>
>Ok..I didn't read the echo statements.  So I guess I have to call uux to
>create the appropriate spool files.  This is something that a CNews
>distribution *for* AmigaUUCP should include.  If I can work it out I
>will certainly make it available.

Yep, it's pretty easy actually; just add a LIST LFORMAT "uux ..."
command to DoBatch.e so that a file is created which can then be
executed to queue up all the files.  In fact, instead of "uux" in the
LFORMAT string I'd use "DoBatch.e3" and write a new script that does
the UUX command for you and then deletes the batch when it receives an
OK response code from UUX.

>However, I don't want to reinvent the wheel here if it's already done.
><grin>  I would *love* to use Christian's ARexx scripts but I haven't
>had any luck finding WShell.  Maybe someone can point me to that as
>well.  Any chance those scripts could be massaged to use the AmigaShell
>under 2.x?? <double grin>

Christian's?  I hadn't seen those.  I was referring to Larry
Rosenman's in my earlier post.  And I know Larry had written some of
his stuff in C so that it ran faster...

Yes, some ARexx scripts can be converted, but I'm not going to do it.
I'd convert them to C anyway, since that way 1.3 users could make use
of them also.

>                                    However, it still doesn't return to
>dobatch.e if it doesn't find a todo file in an out.going/[system]
>directory.  I'm pretty new to AmigaDOS scripts.  What does quit 5 do.  I
>assume it should return me to dobatch.e...

Well, that's what _I_ thought it did.  I'll take a look in my AmigaDOS
reference later...

[It appears that QUIT will terminate the script at any level unless
the FAILAT is set higher than the argument to QUIT, so I've modified
my scripts appropriately.]

>Well, I don't do C (yet) so I guess I will see if I can use either a sys
>flag or relaynews flag to strip the additional NewsArts: out of the togo
>files.

I think that will be successful.  But there's also the possibility
that an AWK or SED or PERL script could trim the volume name as well.
But I'd check for those command line flags first.

>Hopefully that will change in the near future.  It will probably be
>pretty simple to setup CNews for AmigaUUCP once some of the kinks are
>worked out, the scripts are completed *FOR* AmigaUUCP specifically and a
>step-by-step installation procedure is included in a distribution.

Yes, and that's much for feasible now since AmigaUUCP is _the_ UUCP
implementation for AmigaDOS right now.  I think that's a reasonable
step at this point.

><grin>  Anybody selling a copy of AmigaUnix 2.1 cheap? <grin>

Not me!

> Bob Lindabury
>
>InterNet: bobl@bobsbox.rent.com                | Raven Enterprises
>    UUCP: ...rutgers!bobsbox!bobl              | 25 Raven Avenue
>  BitNet: bobl%bobsbox.rent.com@pucc           | Piscataway, NJ 08854
>  Home #: +1 908/560-7353                      | +1 908/271-8878

Good luck.

PS:  I'm posting the docs as formatted by NROFF for the AmigaDOS CONsole
device to alt.sys.amiga.uucp.patches since they're quite a chunk of
uuencoded, compressed text files.  Included are my latest versions of
DoBatch.e, DoBatch.e2, UnBatch.e, and UnBatch.e2.  Also, I'm figuring
that perhaps a.s.a.u.p gets a larger distribution than this group.  If
you don't get that group or miss the posting, email me and I'll send you
a copy. 

[They may be posted in two parts since I'm still formatting 'em and they may be too large for some news facilities.]
-- 
Frank "Crash" Edwards            King Marine Electronics, Inc.
Home: 813/786-3675               Work: 813/530-3411
    Emacs is a fine operating system, but I still prefer Unix.
	    -- stolen from Maurice LeBrun's .signature