William A. Rowe, Jr. wrote:
Steffen wrote:
mod_perl on Windows 2.2.7

Using http://theoryx5.uwinnipeg.ca/ppms/ with ActivePerl 5.8.8.822 FAILS

I'd be happy to see a fix; yes I consider 'as a console' to be a test
environment, but I also consider it to be very useful and worth fixing.
Even the hack to stop a console httpd by-pid is still in status waiting
for a patch, as an Enhancement bug.  So I won't say "no" to fixing.

I posted an updated patch to bug 43534 for 2.2.7 rc.

Currently the parent creates a handle to "NUL" which gets passed to the child and dup'd to stdin after the parent-pipe is closed. This works fine - but it is only done when Apache is started as a service.

Since a parent's console can't be inherited by a child which is started as a detached process - this "NUL" stdout is needed for command-line startups too.

* Apache 2.2.7 started as single process from command-line
 httpd.exe -X
 WORKS OK

Now that's a little nutty.  Would expect -X case to mirror the
other command line case.  Good clues.

In single-process (-X) there is no child process creation, no handle inheritance (or non-inheritance), and the original stdout is a valid console handle. mod_perl is happy with this.

One puzzling thing when trying to follow inheritance. Since change 570303 on the APR 1.2 branch (change 569882 on APR trunk), the functions apr_file_inherit_set() and apr_file_inherit_unset() are commented out and become no-ops for WINNT and higher (i.e. when IF_WIN_OS_IS_UNICODE is true).

See  apr/include/arch/win32/apr_arch_inherit.h  near lines 32 and 55

These function are used a lot in threadproc/win32/proc.c - and also used in Apache's mod_file_cache & mod_mem_cache.

I'm not sure if this change is really intentional or a bug.

-tom-

Reply via email to