httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@lnd.com>
Subject RE: Platform Specific MPM Design Questions
Date Mon, 22 May 2000 18:37:11 GMT
Ok... time for a different direction.

main_win32 is a joke in the context of MPM's.  Service control and the
MPM layer (should be) entirely intertwined, and the existing http_main
won't quite let me do this...

I would like to propose a change to register_hooks (better named
register_module?) since it occurs only once in the process (correct?)
I'd like to pass the process_rec *process from http_main through to
the register_hooks, to accomplish the following:

1) If this is the Win32 mpm, we need two arguments, -k and -n, which
   could be extracted from the argv/argc list, with the clean list
   retained for command argument parsing.  No special mpm arg_hook
   is required for alien arguments.

2) If this is a WinNT service, something very odd needs to happen.

   On pass one, the Service Control Manager is invoked with Apache's
   main() function all over again.  The original main() code path
   never finishes, this is the end of it's life.  This will now be
   invoked by an internal -k runservice flag, rather than console 
   session tests.

   On the second pass, we replace argv[0] with the true argv[0]
   (since it is passed the service name by the SCM, rather than the
   executable name), and we insert -f and -d args from the Win32 
   service control registry.  (These CAN be overriden, however,
   when starting the service.)

This is the end of my cross-platform request... the Win32 specifics...

Everything else I am looking to move into the MPM can happen in the
ap_run_pre_config or ap_post_config_hook phase (depending). 

ap_run_pre_config phase will handle:

   -n servicename -k stop       {we don't care if the config is valid}
   -n servicename -k uninstall  {we really don't care if the config is valid :-}

ap_post_config_hook phase will handle:

   -n servicename -k runservice {internal Win9x only: show the fools their errors}
   -n servicename -k restart    {no sense in restarting if the config has errors}
   -n servicename -k start      {error out if trying to launch with new errors on WinNT}
   -n servicename -k install    {be sure the config is valid, at least at the moment :-)
   and process termination hooks for ^C/Close Window/Stop Service/Shutdown etc...

Yes - I'm trying to do away with the -i/-u oddballs, although we can depreciate
and keep them (with a warning) for now.

I've spent many hours staring at these code paths... I agree it's a hack, but
I need the environment prior to the command line parsing, before much is 
initialized (since the NT service will loop).  But I think all would like to
see every platform run with the same process sequence.  I'm open to any
alternative suggestions.

Bill

ps - where did -D directive parsing go?

Mime
View raw message