perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kjetil Kjernsmo <kje...@kjernsmo.net>
Subject [mp2] Patch for Apache2::Resource defaults problem
Date Wed, 16 Nov 2005 13:33:49 GMT
Hi and a little dahut to all cryptids!

I was trying out the Apache2::Resource module, and decided to try it out 
using just the default configuration. All I got was 
Can't locate object method "server" via package "Apache2" 
at /usr/lib/perl5/Apache2/Resource.pm line 133.

So, I started hacking the source code, putting in Apache2::ServerUtil in 
there, and now it works for me. I must admit that my understanding of 
mp2 is still superficial and it may not be necessary, and that case, 
please clue me in. 

If it is indeed a bug, I have made a little patch on the SVN trunk:

Index: lib/Apache2/Resource.pm
===================================================================
--- lib/Apache2/Resource.pm     (revision 345000)
+++ lib/Apache2/Resource.pm     (working copy)
@@ -26,6 +26,8 @@

 use Apache2::Const -compile => qw(OK);

+use Apache2::ServerUtil;
+
 $Apache2::Resource::VERSION = '1.72';

 our $Debug;
@@ -130,7 +132,7 @@

 if ($ENV{MOD_PERL}) {
     if ($ENV{PERL_RLIMIT_DEFAULTS}) {
-        Apache2->server->push_handlers(
+        Apache2::ServerUtil->server->push_handlers(
             PerlChildInitHandler => \&default_handler);
     }


I haven't actually tested the SVN trunk, just with the mp 2.0.1 I run on 
my system, but I'm sure you guys can see with a blink if this was 
indeed a bug.

BTW, there's a comment in the POD that Linux doesn't support the DATA 
limit, but it is in the manpage on my system, and setting it really low 
seemed to limit it. I'm really no kernel hacker, but googling shows 
that it was discussed in a Linux 2.2 context. So, here's a little diff 
to remove that line, if you also find that it is supported:


Index: Resource.pod
===================================================================
--- Resource.pod        (revision 345000)
+++ Resource.pod        (working copy)
@@ -11,7 +11,6 @@
   # default is 64 Meg
   PerlSetEnv PERL_RLIMIT_DATA 32:48

-  # linux does not honor RLIMIT_DATA
   # RLIMIT_AS (address space) will work to limit the size of a process
   PerlSetEnv PERL_RLIMIT_AS 32:48



I'm not subscribed to the list (sorry for bothering the moderator), so 
please CC any replies.


Cheers,

Kjetil

Mime
View raw message