Thread View: news.software.nntp
1 messages
1 total messages
Started by Doug Sewell
Mon, 23 Sep 1991 16:29
nntp 1.5.11 for NCR Tower - nntpxmit and nntpxfer
Author: Doug Sewell
Date: Mon, 23 Sep 1991 16:29
Date: Mon, 23 Sep 1991 16:29
255 lines
9673 bytes
9673 bytes
NNTP works on the NCR Tower with WIN!!!
This is part one of two parts. This part covers changes to common/conf.h,
nntpxmit, nntpsend.sh, and nntpxfer. The second part will cover changes
to nntpd. All changes are based on the nntp 1.5.11 distribution.
Pardon the format of the patches, I've not really released net software
before, and I'm sure there's better ways than I'm doing it right now.
I'm a transplanted VM-er, fairly unix-literate, but new to C-news and
Unix nntp. Even as I write this I can see some better methods of dis-
tribution and formatting.
Some of the changes reflect that I'm running C-News (8/91 patchlevel). You
may need to do things a little different, or use different directories, for
B-News. I'm also using 'dbz' as my database manager.
If you want some help on building C-news for the NCR, drop me a line, there's
a few small gotchas in that, too (mail vs mailx for outbound mail, -DISTRING,
etc).
First, apply the patches I posted last week to the client code. Don't
build it yet, but it won't hurt if you already have. The same comments
(don't define WIN_TCP or TLI, and expect some preprocessor gripes and
type conflict on integer/pointer for example) apply here. Copies of
the patches are available from the alt.sources archives, or I can mail
them, if they've already expired on your system.
Make these changes to conf.h (other than local customizations):
#define ALONE, because there's no 'inetd' on the Tower.
Optionally, #define FASTFORK. If you have newsreaders that start and
stop connections repeatedly, rather than keep one connection active,
FASTFORK will save start-up time quite a bit.
#undef BSD_43 (you did this for the client code)
#define USG (you did this for the client code)
#define vfork fork
#define NETMASK with whatever value's appropriate.
#define FAKESYSLOG "/usr/lib/news/nntplog" (or wherever you want).
There's not syslog daemon support on the Tower.
I also #define'd 'FAKEAPPEND' - I didn't try it without it. This being
the case, you must 'touch' your FAKESYSLOG file so that it exists before
starting any nntp programs that use the syslog (nntpd, nntpxmit, and nntpxfer).
Also, #define LOG, or the above 2 defines are pretty meaningless. I think
it's a good idea.
After you've made these changes, you probably want to rebuild the client
programs, just in case. The 'make' command is:
make "CFLAGS=-O -I/usr/netinclude -DISTRING -DNCR" "LIBS=-lnet -lnsl -lPW" client
(Your library names may be different on different Tower models).
Here are the patches for nntpxmit. These and all other patches require Larry
Wall's "patch" program to apply. You need to build nntpxmit first, because
some of nntpxmit's routines are used by nntpxfer, as well.
First, you can't patch get_tcp_conn.c as it's named right now - that name
is 14 characters long, so patch can't add the suffix to it. Rename it to
get_tcp_con.c, apply the patch, then rename the patched program to
get_tcp_conn.c.
Apply this patch to get_tcp_con(n).c:
22a23,25
> #ifdef NCR
> #include <sys/twg_config.h>
> #endif
23a27,29
> #ifdef NCR
> #include <sys/in.h>
> #else
24a31
> #endif
Apply this patch to remote.c:
44a45,47
> #ifdef NCR
> #include <sys/twg_config.h>
> #endif
Apply this patch to nntpxmit.c:
71a72,74
> #ifdef NCR
> #include <sys/twg_config.h>
> #endif
158a162
> #ifndef NCR
165a170
> #endif /* NCR */
Finally, run this "make"
make "CFLAGS=-O -I/usr/netinclude -DISTRING -DNCR" "LIBS=-lnet -lnsl -lPW"
Revised nntpsend.sh (you will need to customise it to fit your environment):
If SYSV supported filenames over 14 characters, these changes wouldn't be
necessary. This revised nntpsend.sh works around that, by taking an alias
of the system name from the sys-file entry, and converting that to a full
hostname. This version of 'nntpsend' also handles the C-news 8/91 dropping
of a full directory tree from the files that relaynews creates.
We run '/usr/lib/news/nntpsend.sh host1 host2 host3' from our news user's
crontab every 10 minutes. You could probably handle it by setting up
the batchparms file instead, but this was easier for me to figure out (I'm
not all that familiar with unix news in the first place).
Here's the sample sys-file entry for an outgoing connection:
#
# neoucom.edu - contact cnews@neoucom.edu
neoucom/neoucom.edu,usenet.ins.cwru.edu:biz,bionet,comp,gnu,misc,news,rec,sci,\
cle,oar,oh/all,!ysu,!yng,!pgh,!pa,!nj,!ny,!dc:n:neoucom
#
The selected newsgroups are written to file /usr/spool/news/out.going/neoucom
and are sent to neoucom.edu. Make sure the file name is no more than nine
characters long, because nntpsend.sh puts a '.nntp' on during processing.
Some directory names are different in this version from the distributed
version, reflecting that we're running C-news. Save the original nntpsend.sh
and 'diff' them to see the real differences if you wish.
# This is a shell archive. Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by doug on Mon Sep 23 12:00:44 EDT 1991
# Contents: nntpsend.sh
echo x - nntpsend.sh
sed 's/^@//' > "nntpsend.sh" <<'@//E*O*F nntpsend.sh//'
#!/bin/sh
# $Header: nntpsend.sh,v 1.2 90/08/11 21:27:04 sob Exp $
# What we have here is a sh script for sending netnews to NNTP sites.
#
batchdir=/usr/spool/news/out.going
libdir=/usr/lib/news
spooldir=/usr/spool/news
PATH=${libdir}:/usr/ucb:/usr/bin:/bin:${PATH}
export PATH
pname=`basename $0`
echo ${pname}: "[$$]" begin `date`
#
# Go to where the action is
#
cd $batchdir
umask 022
#
# For NNTP
#
# Here "foo", "bar", and "zot" are the Internet names of
# the machines to which to send. We make the supposition
# that the batch files will be a host's internet name.
# So, for example "nike"'s internet name is "ames-titan.arpa".
# Because of this, your sys file must have "ames-titan.arpa"
# as the batch file output for the machine "nike".
#
for host in ${remotes=$*}
do
@ lock=L.${host}
@ tmp=${host}.tmp
@ send=${host}.nntp
@ if shlock -p $$ -f ${lock} ; then
@ if test -f ${tmp} ; then
@ cat ${tmp} >> ${send}
@ rm ${tmp}
@ fi
# we let the tmp file cool off for a while if there's other work to do
# and we pick it up again during next iteration
@ if test -f ${host} ; then
@ if test -f ${send} ; then
@ mv ${host} ${tmp}
@ else
@ mv ${host} ${send}
@ fi
@ fi
@ if test -f ${send} ; then
@ echo ${pname}: "[$$]" begin ${host}
# translate the pseudo-host-name to the real host name.
if [ "$host" = "neoucom" ]; then
@ realhost=neoucom.edu
@ fi
if [ "$host" = "ysub" ]; then
@ realhost=ysub.ysu.edu
@ fi
#if "realhost" isn't set, print an error and bail out
if [ "$realhost" = "" ]; then
@ echo "real host name for $host must be configured."
@ exit 1
@ fi
# messing around because of c-news 8/91 patches eliminated full path
@ cd $spooldir
@ send=$batchdir/$send
# time nntpxmit ${host}:${send}
@ time nntpxmit ${realhost}:${send}
@ echo ${pname}: "[$$]" end ${host}
# undo c-news 8/91 messing-around.
@ cd $batchdir
@ fi
@ rm -f ${lock}
@ else
@ echo ${pname}: "[$$]" ${host} locked by "[`cat ${lock}`]"
@ fi
done
echo ${pname}: "[$$]" end `date`
@//E*O*F nntpsend.sh//
chmod u=rwx,g=rx,o= nntpsend.sh
exit 0
<<< end of shar of nntpsend.sh >>>
Nntpxfer changes for the NCR:
You're going to get an error message about 'server redefined' in this,
it's intentional. One of the WIN includes defines 'server', which is
the name of the socket here. Here's the patch for nntpxfer.c:
30a31,35
> #ifdef NCR
> #undef NDIR
> #include <sys/twg_config.h>
> #define server news_server
> #endif
To build this with the C-news 'dbz' package, copy dbz.h and dbz.o from C-news
into the base nntp directory, cd to the xfer directory, then run this make:
make "CFLAGS=-O -I.. -I/usr/netinclude -DISTRING -DNCR" "LIBS=-lnet -lnsl -lPW ../dbz.o"
The install routines don't install the nntpxfer program. I shoved it into
/usr/lib/news/nntpxfer, with mode 750, owner/group news/news. That's also
where I put 'nntpxmit' and 'nntpsend.sh'.
A followup posting to this will have the changes to nntpd, how to set it up
on a tower, and some things I've learned in the process.
Followups are set to comp.sys.ncr. Comments are welcome, flames ignored,
and no guarantees offered except that it works for me, and I'll take a look
at what problems you have.
G'luck, Doug (who posted this to an nntpd on a Tower)
--
Doug Sewell, Tech Support, Computer Center, Youngstown State University
doug@ysu.edu, doug@ysub.bitnet, news@yfn.ysu.edu, ...!uunet!ysu.edu!doug
"You have to be careful not to get locked into Open Systems" - reportedly
said by Three Letter Acronym sales-critter.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads