C News breaks on UNIXPC

Todd Day todd at ivucsb.sba.ca.us
Tue Jun 13 15:21:56 AEST 1989


General hints for those trying to bring up C news on a UNIXPC from
someone who's been there:

First off, make sure you run all scripts from /bin/sh, and not ksh, as
some of the scripts use egrep, which for some reason does not like
to run in a script from ksh (it does work from the command line,
though).  Also, the inews script that appears in /usr/bin or /usr/local/bin
(NOT the one in /usr/lib/news) must also be run from /bin/sh, for
the same reason.  This means you must edit Pnews
(inews="/bin/sh /usr/bin/inews") and postnews
(last line /bin/sh /usr/bin/inews).

Secondly, it appears that setuid(geteuid()) does NOT work on this
machine, so make sure that you answer NO to that question in conf/build.
Don't let the test in relay/regress fool you.  First time through, I
answered yes to this question, and the test worked, as I was running
from root.  However, after you install relaynews, it runs setuid to
news, and all you get back from relaynews is
\)
and an error message (haven't been able to track this one down).

Thirdly, even though this machine does have ldiv, it apparently is
NOT ansi standard.  So, instead of getting multiply defined ldivs,
I lied to conf/build and said I had ansi ldiv.  The only place it is
used is libcnews/ltoza.c.  I replaced the section that uses ldiv
with

	while (wwid-- > 0) {		/* generate "wwid" digits */
		register long remainder;

		remainder = wval % (long)RADIX;
		wval /= (long)RADIX;	/* what the hell was here before? */
		*op-- = remainder + '0';
	}

This does the fix the same way they fake ldiv in fakelib (what was this done
for in the first place?).  The reason I had to do this in the first place
was a bus error... ldiv was returning what was supposed to be long ints
on a non-word (odd-address) boundary.

Last, but not least, is the change for conf/spacefor.proto.  Since the UNIXPC
can't seem to find the file system a particular directory is on, you'll
have to give df the mounting directory of the file system that your
news spool is on.  Here's what I did (replace that awful awk script stuff):

# this is set up for UNIXPC df
nb=`df / | cut -c24-32`
nb=`expr $nb - $desire`
if [ "$nb" -gt "0" ]
then
	echo `expr $nb \* $dfunit`
else
	echo 0
fi


Well, I know some of this stuff is hacked looking, but it works.  I spent
about 9 hours getting this up, so hopefully these hints will help you
get this stuff up quickly.  Cnews is much faster than Bnews, except for
the news posting.  I would like to see a non-scripted inews.

-- 

Todd Day | todd at ivucsb.sba.ca.us | ivucsb!todd at anise.acc.com
"All theory, no practice.  That's the story of my life."



More information about the Comp.sys.att mailing list