🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #36515

Re: setrlimit(RLIMIT_STACK, RLIM_INFINITY) error in INN 1.7.2 errlog (on RH5.2)

#36515
From: Russ Allbery
Date: Tue, 13 Apr 1999 00:00
34 lines
2245 bytes
Arthur Hagen <art@flying.broomstick.com> writes:

> The rlim_cur applies to the running task, and my wild guess is that
> HP-UX will only let you change the behaviour of future tasks.  I should
> try to fork/vfork off a few tasks to see what happens to them.

That doesn't make sense either... rlim_cur should simply be the soft
limit, and it should be inherited by child processes.  I've never heard of
setting limits only for the behavior of future tasks; Unix normally
doesn't work like that.

> Doing two setrlimit calls won't help much.  A small test program to
> verify this:

I modified your program to deal with the file descriptor limit, since
that's what one mostly cares about with news servers, and it turns out
that, apparently like Linux, you can't set the limit to RLIM_INFINITY
(even the hard limit).  I'm not sure what the upper limit *is*, though,
since I was able to set it to values as high as 32000.

Linux, on the other hand, didn't let me set it higher than 256 (this is
with a 2.0.x kernel).

Anyway, for file descriptors, it looks to me like the right thing to do on
HP-UX may be to simply raise the soft limit to the same as the hard limit.
I wonder if it wouldn't be good to do that on all platforms regardless of
configuration settings, since that isn't a privileged operation and it's
hard to imagine when that could possibly be wrong (it just might not be
enough).

-- 
Russ Allbery (rra@stanford.edu)         <URL:http://www.eyrie.org/~eagle/>

Technical Details
Message-ID: <ylhfqk6my3.fsf@windlord.stanford.edu>
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!not-for-mail
References: <7er2ol$qtg$1@news1.guiware.com> <yllnfykc9c.fsf@windlord.stanford.edu> <hlmre7.bcs3.ln@flying.broomstick.com> <ylvhf2fr7c.fsf@windlord.stanford.edu> <fpkte7.vrm3.ln@flying.broomstick.com>

Show Full Headers
Complete Article Headers
Message-ID: <ylhfqk6my3.fsf@windlord.stanford.edu>
Subject: Re: setrlimit(RLIMIT_STACK, RLIM_INFINITY) error in INN 1.7.2 errlog (on RH5.2)
Date: Tue, 13 Apr 1999 00:00:00 +0000
From: Russ Allbery <rra@stanford.edu>
References: <7er2ol$qtg$1@news1.guiware.com> <yllnfykc9c.fsf@windlord.stanford.edu> <hlmre7.bcs3.ln@flying.broomstick.com> <ylvhf2fr7c.fsf@windlord.stanford.edu> <fpkte7.vrm3.ln@flying.broomstick.com>
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!not-for-mail
X-Deja-AN: 466104763
Organization: The Eyrie
Newsgroups: news.software.nntp