Article View: news.software.nntp
Article #50659Re: launching nnrpd
From: Sven Paulus
Date: Fri, 16 Feb 2001 13:27
Date: Fri, 16 Feb 2001 13:27
51 lines
3338 bytes
3338 bytes
Charlie Chatterbox <autocyberretributionmeowbot@pl0nk.invalid> wrote:
> :: I don't entirely trust nnrpd -D yet; it has some oddities. I prefer to
> :: use an inetd equivalent (I use tcpserver). But that may just be me. In
> Hmmm, oddities? Care to go into detail, apart from those already
> known? I'm using -D to start two of the three nnrpds on our play
> swerver, and I see no more problems there than with the third one
> that shouldn't do what it does but they all do anyway.
There are some little problems, but I haven't found time recently
to produce patches:
do {
clen = sizeof(csa);
fd = accept(lfd, (struct sockaddr *) &csa, &clen);
if (fd < 0)
continue;
for (i = 0; (pid = fork()) < 0; i++) {
if (i == MAX_FORKS) {
syslog(L_FATAL, "cant fork (dropping connection): %m");
>> continue;
}
syslog(L_NOTICE, "cant fork (waiting): %m");
sleep(1);
}
if (pid != 0)
close(fd);
} while (pid != 0);
The marked line was a goto to the topmost line in the first version of -D.
That paragraph got changed to a do-{-}-while-construct, but this continue
has to continue the while-loop and not the for-loop (otherwise if forking
fails continuosly, the parent nnrpd would loop forever, even if the client
is gone away in the meantime). So, adding "&& (i<=MAX_FORKS)" might be a
good idea. It's nothing serious, but it's clearly wrong the way it is.
The second thing is, the signal handler for SIGHUP is set up after
forking the child process. So, if you want to be clever and set all the
child processes into trace-mode using "killall -HUP nnrpd", the parent
process dies. Maybe it should ignore SIGHUP or even to something clever
(rereading inn.conf, which might be easier for nnrpd than it is for innd).
I have some basic rate and connection limiting code ready for nnrpd, but
it needs some clean up and I have to adopt it to inn-current, since I wrote
it for 2.2. Maybe I'll find some spare time ...
Apart from this, I don't see any problems using nnrpd -D. It's stable and
it's fast (-> copy-on-write for the child processes).
Sven
Technical Details
Message-ID:
<96j9r8$i4m$1@sapa.inka.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!193.174.75.178!news-fra1.dfn.de!news-fra.pop.de!schlund.de!inka.de!not-for-mailReferences:
<3A8BC46A.F05EF780@bellatlantic.net> <ylzofnplni.fsf@windlord.stanford.edu> <96igve$d13$1@warpednews.warpedworld.tele.dk>Show Full Headers
Complete Article Headers
Message-ID: <96j9r8$i4m$1@sapa.inka.de>
Subject: Re: launching nnrpd
Date: Fri, 16 Feb 2001 13:27:04 +0000
From: Sven Paulus <sven@karlsruhe.org>
References: <3A8BC46A.F05EF780@bellatlantic.net> <ylzofnplni.fsf@windlord.stanford.edu> <96igve$d13$1@warpednews.warpedworld.tele.dk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!193.174.75.178!news-fra1.dfn.de!news-fra.pop.de!schlund.de!inka.de!not-for-mail
Newsgroups: news.software.nntp
Organization: (Posted via) INKA e.V. http://www.inka.de/
Lines: 50
NNTP-Posting-Host: puric.inka.de
X-Trace: sapa.inka.de 982330024 18582 212.227.14.17 (16 Feb 2001 13:27:04 GMT)
X-Complaints-To: newsmaster@inka.de
NNTP-Posting-Date: 16 Feb 2001 13:27:04 GMT
User-Agent: tin/1.5.7-20001104 ("Paradise Regained") (UNIX) (Linux/2.0.36 (i686))