🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #1338

nntp 1.5.11 for NCR Tower - nntpd

#1338
From: Doug Sewell
Date: Mon, 23 Sep 1991 20:39
181 lines
5652 bytes
Ahh... and the patches are shar'd, no less!

This is the final set of patches for nntp 1.5.11 on an NCR Tower with
WIN-TCP.  I'm going to be repackaging the previous patches in shar
format and posting them later today.  I'll also put an already-patched
set out for anonymous ftp tomorrow on cc.ysu.edu.

Some comments about the NCR environment:

There's no inetd, so nntpd has to be started at boot time.  It must
be started by root, because of the bind to port 119.  The easiest place
to put that is in /etc/rc1.d/S99localnews  (assuming that run level 1
is your multi-user run-level).  Here's what we do:


# run C-news cleanup processes
echo Running C-news cleanup...
su news -c /usr/lib/newsbin/maint/newsboot
mv /usr/lib/news/nntplog /usr/lib/news/nntplog.o
touch /usr/lib/news/nntplog
chown news /usr/lib/news/nntplog
chgrp news /usr/lib/news/nntplog
chmod 664 /usr/lib/news/nntplog
echo Starting nntpd...
/usr/lib/news/nntpd

At shutdown time, nntpd has to be killed before the disks are
unmounted.  One of the changes to main.c causes the file SPOOLDIR/nntpd.pid
(usually /usr/spool/news/nntpd.pid) to be created with the pid of the
daemon in it.  This way, you can put this in /etc/rc6.d/K40localnews,
and also into /etc/rc0.d/K02localnews for single-user shutdown:

/bin/echo Killing nntpd...
/bin/kill -9 `/bin/cat /usr/spool/news/nntpd.pid`

The numbers (K40, etc) are significant, because the order that files
appear in the respective directories are the order that the scripts
are performed.  You don't want to wait until after the disks are un-
mounted or WIN is down before killing off nntpd, or he writes all kinds
of trash to his log-file.

Finally, this wasn't nearly as bad as I thought it would be to do.  Here's
the patches - apply the .cp patches to the .c files in nntp.1.5.11/server,
and the .hp patches to the respective .h file.

Take note of the "gross hack" in timer.c - it really works, I put a syslog
message in group.c to see if it actually popped the timer and reread the
active file.

# 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 16:14:19 EDT 1991
# Contents:  access_inet.cp main.cp misc.cp netaux.cp scandir.cp subnet.cp
#	timer.cp common.hp

echo x - access_inet.cp
sed 's/^@//' > "access_inet.cp" <<'@//E*O*F access_inet.cp//'
8a9,11
> #ifdef NCR
> #include <sys/in.h>
> #else
9a13
> #endif
@//E*O*F access_inet.cp//
chmod u=rw,g=rw,o=r access_inet.cp

echo x - main.cp
sed 's/^@//' > "main.cp" <<'@//E*O*F main.cp//'
17a18,20
> #ifdef NCR
> #include <sys/in.h>
> #else
18a22
> #endif
46a51,57
> #ifdef NCR
> /* while not really necessary, this is a real help to me */
> 	FILE *pid_file;
> 	char pid_filename[100];
> 	strcpy(pid_filename,SPOOLDIR);
> 	strcat(pid_filename,"/nntpd.pid");
> #endif
54a66,70
> #ifdef NCR
> 	pid_file = fopen(pid_filename,"w");
> 	fprintf(pid_file,"%d\n",getpid());
> 	fclose(pid_file);
> #endif
@//E*O*F main.cp//
chmod u=rw,g=rw,o=r main.cp

echo x - misc.cp
sed 's/^@//' > "misc.cp" <<'@//E*O*F misc.cp//'
617a618
> #ifndef NCR
657a659
> #endif
@//E*O*F misc.cp//
chmod u=rw,g=rw,o=r misc.cp

echo x - netaux.cp
sed 's/^@//' > "netaux.cp" <<'@//E*O*F netaux.cp//'
11a12,14
> #ifdef NCR
> #include <sys/in.h>
> #else
12a16
> #endif
15a20
> #ifndef NCR
16a22
> #endif
@//E*O*F netaux.cp//
chmod u=rw,g=rw,o=r netaux.cp

echo x - scandir.cp
sed 's/^@//' > "scandir.cp" <<'@//E*O*F scandir.cp//'
21a22,24
> #ifdef NCR
> #include <dirent.h>
> #endif
28a32,34
> #ifdef NCR
> 	register struct dirent  *dirent;
> #else
29a36
> #endif
@//E*O*F scandir.cp//
chmod u=rw,g=rw,o=r scandir.cp

echo x - subnet.cp
sed 's/^@//' > "subnet.cp" <<'@//E*O*F subnet.cp//'
9a10,12
> #ifdef NCR
> #include <sys/twg_config.h>
> #endif
10a14,16
> #ifdef NCR
> #include <sys/in.h>
> #else
11a18
> #endif
14a22
> #ifndef NCR
15a24
> #endif
@//E*O*F subnet.cp//
chmod u=rw,g=rw,o=r subnet.cp

echo x - timer.cp
sed 's/^@//' > "timer.cp" <<'@//E*O*F timer.cp//'
20a21,26
> /* the following three lines are a VERY GROSS HACK.  WIN-TCP on the NCR */
> /* handles timers, select, etc more like BSD4.2 than USG.  So, we pretend */
> /* (in this source module only) to not be USG any more. */
> #ifdef NCR
> #undef USG
> #endif
@//E*O*F timer.cp//
chmod u=rw,g=rw,o=r timer.cp

echo x - common.hp
sed 's/^@//' > "common.hp" <<'@//E*O*F common.hp//'
12a13,16
> #ifdef NCR
> #undef NDIR
> #include <sys/twg_config.h>
> #endif
@//E*O*F common.hp//
chmod u=rw,g=rw,o=r common.hp

exit 0

Doug
--
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.
Technical Details
Message-ID: <1991Sep23.203944.18682@yfn.ysu.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!wupost!uunet!icd.ab.com!usenet.ins.cwru.edu!ysub!yfn.ysu.edu!yfn!doug

Show Full Headers
Complete Article Headers
Message-ID: <1991Sep23.203944.18682@yfn.ysu.edu>
Subject: nntp 1.5.11 for NCR Tower - nntpd
Date: Mon, 23 Sep 1991 20:39:44 GMT
From: doug@yfn.ysu.edu (Doug Sewell)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!wupost!uunet!icd.ab.com!usenet.ins.cwru.edu!ysub!yfn.ysu.edu!yfn!doug
Newsgroups: comp.sys.ncr,news.software.nntp,alt.sources
Followup-To: comp.sys.ncr
Sender: news@yfn.ysu.edu
Nntp-Posting-Host: yfn
Organization: Youngstown Free-Net Project, Youngstown, Ohio, USA