You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Stas Bekman <st...@stason.org> on 2004/04/05 06:36:46 UTC
Re: [Apache-Test] ulimit on Solaris bash
Kinyon, Rob wrote:
> That sounds about right.
>
> I would also recommend adding something to the README for Solaris 8 & 9
> indicating that core files may not be generated, even if they normally
> would be, depending on the initial ulimit -c setting. I say 8 & 9
> because I don't know if the ulimit restriction has always been there or
> if it changed at some point.
> So the logic should be:
>
> skip running 'ulimit' if $^O eq 'solaris' and $user ne 'root'.
>
> it that correct?
I've commited the following patch. Rob or Toby, can you please confirm that it
skips correctly the ulimit run when run as non-root on Solaris. Thanks!
Index: lib/Apache/TestConfig.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.217
diff -u -r1.217 TestConfig.pm
--- lib/Apache/TestConfig.pm 1 Apr 2004 23:57:17 -0000 1.217
+++ lib/Apache/TestConfig.pm 5 Apr 2004 04:34:30 -0000
@@ -20,6 +20,7 @@
use constant WIN32 => $^O eq 'MSWin32';
use constant CYGWIN => $^O eq 'cygwin';
use constant NETWARE => $^O eq 'NetWare';
+use constant SOLARIS => $^O eq 'solaris';
use constant WINFU => WIN32 || CYGWIN || NETWARE;
use constant COLOR => ($ENV{APACHE_TEST_COLOR} && -t STDOUT) ? 1 : 0;
Index: lib/Apache/TestRun.pm
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm,v
retrieving revision 1.162
diff -u -r1.162 TestRun.pm
--- lib/Apache/TestRun.pm 25 Mar 2004 01:31:28 -0000 1.162
+++ lib/Apache/TestRun.pm 5 Apr 2004 04:34:31 -0000
@@ -616,6 +616,17 @@
sub set_ulimit_via_sh {
return if Apache::TestConfig::WINFU;
return if $ENV{APACHE_TEST_ULIMIT_SET};
+
+ # only root can allow unlimited core dumps on Solaris (8 && 9?)
+ if (Apache::TestConfig::SOLARIS) {
+ my $user = getpwuid($>) || '';
+ if ($user ne 'root') {
+ warning "Skipping 'set unlimited ulimit for coredumps', " .
+ "since we are running as a non-root user on Solaris";
+ return;
+ }
+ }
+
my $binsh = '/bin/sh';
return unless -e $binsh;
$ENV{APACHE_TEST_ULIMIT_SET} = 1;
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html