🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #36468

Problem with setrlimit()

#36468
From: Kare Presttun
Date: Mon, 12 Apr 1999 00:00
63 lines
2465 bytes
I have the same problem here as well (INN 1.7.2 on RH 5.2)
so maybe the Linux gurus can contribute?

Best regards,
Kåre

Bettina Fink <laura@terpen.tin.org> writes:

> I had the same with an self-compilied innfeed on Linux.
>
> Get the innfeed sources, change the RLIMIT_NOFILE section in
> startinnfeed.c to:
>
>   setrlimit(RLIMIT_NOFILE, &rl);
> #if 0
>   if (setrlimit(RLIMIT_NOFILE, &rl) == -1)
>     (void)fprintf(stderr, "%s: setrlimit(RLIMIT_NOFILE, RLIM_INFINITY): %s\n",
>             *av, strerror (errno));
> #endif
>
> Recompile, be happy.

Er... isn't that just removing the reporting of a legitimate error?  Why
is setrlimit() failing on Linux?

-- 
Russ Allbery (rra@stanford.edu)        
<URL:http://www.eyrie.org/~eagle/>
-----------------------------------------------------
Bettina Fink <laura@terpen.tin.org> writes:

> From setrlimit(2):

>      EPERM  A non-superuser tries to use setrlimit() to
>             increase the soft or hard limit above the current
>             hard limit,

As startinnfeed is running as root, this shouldn't be a problem.

>             or a superuser tries to increase RLIMIT_NOFILE above the
>             current kernel maximum.

As it's setting it to INFINITY, this shouldn't be a problem either, as
that should simply make it the largest possible value for the current
kernel compile.  So I'm still confused.

-- 
Russ Allbery (rra@stanford.edu)        
<URL:http://www.eyrie.org/~eagle/>
-- 
Kåre Presttun, Security Officer, Alcanet International
------------------------------------------------------
Tel   : +47 2263 7601  mailto:Kare.Presttun@alcatel.no
Fax   : +47 2263 8887           http://www.alcatel.no/
Mobile: +47 9082 7068

Technical Details
Message-ID: <3711CD7D.78424002@alcatel.no>
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

Show Full Headers
Complete Article Headers
Message-ID: <3711CD7D.78424002@alcatel.no>
Subject: Problem with setrlimit()
Date: Mon, 12 Apr 1999 00:00:00 +0000
From: Kare Presttun <Kare.Presttun@alcatel.no>
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: 465426912
Content-Transfer-Encoding: quoted-printable
X-Accept-Language: en
Content-Type: text/plain; charset=iso-8859-1
Organization: Alcanet International
Mime-Version: 1.0
Newsgroups: redhat.kernel.general,linux.redhat.misc,news.software.nntp