[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: story - part 3

On Sat, 07 Aug 1999, Mikolaj J. Habryn wrote:

>     k> 4) Setting limits still doesn't work.  if(setrlimit(*++op,
>     k> rlimittab_get(*++op))) { wrong args are passed to setrlimit()
> [...]
>     k> 	case OP_RLIMIT: if(setrlimit(*op, rlimittab_get(*(op+2))) < 0)
>     k> { rl_fail1("setrlimit"); } op=op+2; break;
>   This should not work. This should seriously not work. What compiler
> are you using? I can set rlimits here 'til the cows come home, and
> they all work correctly. Can you please email me an entire
> configuration that doesn't set limits correctly? Maybe one of the
> other directives that you have in there causes things to work
> differently, which would be why I can't reproduce it... are you
> running on some exotic hardware, by any chance?

I usualy use 'gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)'.
but this time I used 'gcc version' and even 'gcc version gcc-2.95 19990629 (prerelease)'.
Result is that same for all these compilers:
I added 
                        case OP_RLIMIT:
                                rl_warn("setrlimit(%d, struct rlimit { rlim_cur %d; rlim_max %d };);", *++op, rlimittab_get(*++op)->rlim_cur, rlimittab_get(*op)->rlim_max);
//                              if(setrlimit(*++op, rlimittab_get(*++op)))
//                                      rl_fail1("setrlimit");

and results:
Aug  9 13:48:24 linstar rlinetd[9781]: rlinetd configuration (re)loaded, 12816 bytes used
Aug  9 13:48:27 linstar rlinetd[9783]: setrlimit(0, struct rlimit { rlim_cur 0; rlim_max 1 };);
Aug  9 13:48:27 linstar rlinetd[9783]: setrlimit(1, struct rlimit { rlim_cur 5; rlim_max 1 };);
Aug  9 13:48:37 linstar rlinetd[9781]: OP_CLOSE closing already closed socket

Also I compiled rlinetd without any optimalization but that didn't help ;-(

My config for this service (/etc/rlinetd.d/test):

service "test" {
    protocol tcp;
    port "3000";
    user "misiek";
    exec "/bin/bash -i";
    server "/usr/sbin/tcpd";
    rlimit nproc {
        soft 5; hard 10;
    rlimit cpu {
        soft 9; hard 11;

My hardware isn't exotic ;-) Intel Pentium MMX, Soyo mainboard ....

> m.

arkadiusz miśkiewicz        [misiek@misiek.eu.org]
[P]olish [L]inux [D]istribution with IPv6 support
http://www.ipv6.pld.org.pl/ http://www.pld.org.pl/