I have a theory which may or may not be correct, but I'm not sure 
where to go next.

Embperl is loading and executing just fine the first time.
However the second time the config file is read (by standalone_main) 
it is *not* loaded properly.  This is true whether or not 
standalone_main is executed in the same process (-X) or in a child 
process.

(At some point someone should explain to me why Apache dynamically 
loads all its modules and the "unloads" them and does it all over 
again.  I see that mod_auth_digest explicitly does nothing on the 
first load, since it knows there's a second one coming._

MOD_PERL_TRACE=all sudo /usr/local/apache/bin/httpd -X
perl_parse args: '/dev/null' ...allocating perl interpreter...ok
constructing perl interpreter...ok
ok
running perl interpreter...ok
mod_perl: 0 END blocks encountered during server startup
loading perl module 'Apache'...loading perl module 
'Apache::Constants::Exports'...ok
ok
PerlModule: arg='Embperl'
loading perl module 'Embperl'...ok
## The next call results from the PerlHandler, so all is well
init `PerlHandler' stack
perl_cmd_push_handlers: @PerlHandler, 'Embperl'
pushing `Embperl' into `PerlHandler' handlers
## At this point standalone_main runs, and the output goes to the log file
loading perl module 'Apache'...ok
perl_startup: perl aleady running...ok
loading perl module 'Apache'...ok
cleanup_sv: SvREFCNT(0xf1738)==1
loading perl module 'Apache'...ok
loading perl module 'Apache'...ok
PerlModule: arg='Embperl'
loading perl module 'Embperl'...ok
## The next thing should be the PerlHandler call
## But we never make it that far.
Syntax error on line 28 of /usr/local/apache/conf/srm.conf:
Invalid command 'EMBPERL_APPNAME', perhaps mis-spelled or defined by 
a module not included in the server configuration

If we move EMBPERL_APPNAME until after the PerlHandler, the first 
pass works fine, the second place manages the PerlHandler just fine, 
but we still die on the EMBPERL_APPNAME.

If I take out the keyword, things just die later, so that's not useful.

So, here's where I am.

A lot of debugging output shows me that the first time PerlModule 
Embperl is read, the init routine for Embperl gets called, and in 
particular, embperl_ApacheAddModule gets called, and it calls 
ap_add_module.  The second time it does *not* get called.

The problem is, I can't figure out when it's being called.  From 
looking at the code, it looks like all init() routines are called 
from ap_init_modules(), but the first time it's being called as soon 
as it is loaded. (and ap_init_modules() runs after the config file is 
processed anyway). So my next guess is that it's being called from 
Embperl.pm when it's loaded.  However the *second* time, since Perl 
is already running, that code does not get re-executed, and Init is 
not called, and as a result, add_module isn't called.

The more my sleep addled brain thinks about this, the more it makes 
sense. But it leaves two questions.

1. How can I force Init (or more specifically, ap_add_module) to be 
called both times.
2. Why is this only causing problems for me and nobody else?


-- 

Kee Hinckley - Somewhere.Com, LLC
http://consulting.somewhere.com/
[EMAIL PROTECTED]

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

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

Reply via email to