[news.software.b] relaynews x-posting problem solved.

jp@tygra.UUCP (John Palmer) (04/12/91)

Solved the crossposting problem that I was having.

Problem: I had to make a separate filesystem out of /usr/spool/news/comp
as I was running out of INODES for news. Xenix only allows ~65k INODES
per filesystem. The problem occurred when an article came in that was
crossposted to comp.* and some other hierarchy. Relaynews creates the 
file for the article for the first newsgroup listed and creates links
to that file for all of the other newsgroups to which the article is 
posted. XENIX doesn't allow cross-filesystem links, so relaynews would 
drop any such articles down the bit-bucket.

Solution: Hack the files fileart.c and relaynews.c to do the following:
In the main pgm, create an empty file called "/tmp/rncpcmds". Then, 
change the function mkonelink (which files an article by either creating
the file for it, or creating a link to a file which already exists) to
call the function "copyart" if the link fails. 

Copyart takes two args: char *orig, *new

orig is the name of the file which contains a copy of the article.
new is the name of the file into which it is to be copied. 

Copyart appends the command "/bin/cp <orig> <new>" to the /tmp/rncpcmds
file.

At the end of main, simply send the command "sh /tmp/rncpcmds" to the 
"system" function, then, of course, unlink the file /tmp/rncpcmds just
to be neat.

I know its a kludge, but it works. If anyone wants the hacked code for
fileart.c and relaynews.c, let me know.
 
John Palmer
-- 
CAT-TALK Conferencing System   |  "Buster Bunny is an abused | E-MAIL:
+1 313 343 0800 (USR HST)      |   child. Trust me - I'm a   |  jp@tygra.UUCP
+1 313 343 2925 (TELEBIT PEP)  |   professional..."          | ..sharkey!tygra!
********EIGHT NODES*********** |   -- Roger Rabbit           | ..jp

news@heitis1.uucp (News Administrator) (04/17/91)

In article <1991Apr12.121017.4804@tygra.UUCP> jp@tygra.UUCP (John Palmer) writes:
>Solved the crossposting problem that I was having.
>
>Problem: I had to make a separate filesystem out of /usr/spool/news/comp
>as I was running out of INODES for news. Xenix only allows ~65k INODES
>per filesystem. The problem occurred when an article came in that was
>crossposted to comp.* and some other hierarchy. Relaynews creates the 
>
>Solution: Hack the files fileart.c and relaynews.c to do the following:
>In the main pgm, create an empty file called "/tmp/rncpcmds". Then, 
>change the function mkonelink (which files an article by either creating
>the file for it, or creating a link to a file which already exists) to
>call the function "copyart" if the link fails. 
>

Problem: Suppose the file is cross-posted to:
comp.sources.d,alt.sources,alt.aquaria,soc.womyn, etc....

It will create 4 copies of the article in this case.  I had patches which
took care of this at one point, not because of Inodes, instead disk space
(4 40Meg HD's).  What I did, was attempt to make a link, if it failed, I
did a copy, and then on subsequent links tried both names.  This continued
until all cross-postings had been either, linked, or copied, or linked to
copies, etc, ad-infinitum.  I will see if I can find the patches and send
them, and if anyone else is interested, I can also post'em.

	brian