On Thu, 30 Aug 2001, Doug MacEachern wrote:

> On Fri, 31 Aug 2001, Stas Bekman wrote:
>
> > Yes, if we are using BSD::Resource. I'm not sure how can you do it from
> > Perl if using 'ulimit' shell's built-in command.
>
> oh, i didn't realize its a shell built in.
> but you should be able make a wrapper like so:
> #!/bin/sh
> ulimit -c unlimited
> ./t/TEST $@

I know that I can :) my concern are users. see below.

> > just before ./t/TEST is run in Makefile, is the simplest solution. Or
> > would this have cross-platform problems.
>
> i hardly ever use 'make test', especially with httpd-test.  i just run
> t/TEST directly.  and think about nightly batch jobs that will 'make' once
> and run t/TEST many:
> t/TEST apxs ~/ap/prefork/bin/apxs
> t/TEST -ssl
> t/TEST apxs ~/ap/worker/bin/apxs
> t/TEST -ssl
> t/TEST -proxy
> etc.

but setting 'ulimit' in the parent shell once is enough. So if you run
once 'make', it should be good enough to unset the limit.

Hence I thought what would be the damage if we put into Makefile:

test :: set_limit pure_all run_tests test_clean unset_limit

set_limit:
        cur_limit=`ulimit -c`
        ulimit -c unlimited

unset_limit:
        # restore the limit to its originals
        ulimit -c $cur_limit

I'm not worried about us, but more trying to layout an easy ground for
the future users, so they will ask less questions and more answers will be
automagically answered for us. You've started this already by adding the
scan, but if the core file won't be allowed to be created, scan will be
useless for them. And I think that most linux distros do not allow
coredump files by default.

% grep limit /etc/profile
[ "$UID" = "0" ] && ulimit -c 1000000

% grep limit /etc/csh.cshrc
[ "`id -u`" = "0" ] && limit coredumpsize 1000000

so they set only for root users, which is bad for us.

Hmm, I don't know what's the best way to handle this so it'll
be crossplatform (at least that it won't generate errors on systems that
don't support bash). I've search google to find some clues, but couldn't
find any.

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://localhost/      http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to