William A. Rowe, Jr. wrote:
At 02:18 PM 11/10/2003, you wrote:

Bill Stoddard wrote:
[...]

Any ideas how to avoid the second call to initalize_module when I run as a service ?


You can't avoid the second call but there are ways to gracefully handle it. Here is a snip of code from a module I developed a while back:

[...] and I posted a patch which provides a generic API to do that. Since everybody is replicating this code. And the thread has died w/o resolution. For some reason http://marc.theaimsgroup.com doesn't have my original post, but only the rest of the (unfinished) thread.


Stas,

  Since the work arounds (such as Bill suggested) are required for 1.3 and 2.0
compatiblity already, it seems we should focus on 2.1 and solve this for good.

1.3 has some sort of facility to know when restart happens. But we do need it for 2.0 as well. Why can't it be provided in 2.0 as well?


  We have a new facility, ap_mpm_query, which would be perfect for answering
nuggets of wisdom such as;

  1) Running as a win32 service?  Or detached console daemon?
  2) A parent process?  (Pre-fork or never forking (e.g. win32?)
  3) Pre-startup config testing?
  4) Server generation?  (This answers the 2nd, 3rd, 4th startup pass question)

  These sorts of answers are useful to alot of modules, but we don't need a new
callback to add them - simply build upon the ap_mpm_query() options.

[I've changed * bullets to numberical bullets above]


I think all but the 3rd item fit the bill. pre-startup config happens in the core (main) and not in the mpm code and not specific to the mpm implementation. Do you still think it belongs to ap_mpm_query?

I agree with 1, 2 and 4.

Regarding 4, should it return a AP_MPM_ACTION_(START|RESTART|GRACEFUL|STOP) value (all 4 need to be defined if they aren't already)

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Reply via email to