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: cvs commit: apache-1.3/src/os/win32 service.c
Date Thu, 15 Jun 2000 20:10:35 GMT
> From: Keith Wannamaker [mailto:krw@raleigh.ibm.com]
> Sent: Thursday, June 15, 2000 2:50 PM
> To: new-httpd@apache.org
> Subject: RE: cvs commit: apache-1.3/src/os/win32 service.c
> 
> I am -1 on this unless you have thoroughly, extensively tested this on
> every Win32 platform on which Apache runs.

-every- Win32 is reduced to -every- WinNT platform by the first test :)

I have thoroughly disected it on NT 4.0 sp6.  I will be testing sp3, and
I have asked Andrew (yet again :) to test the Win2000, since he has been
-extremely- thorough in all his tests to date.  I will also consult the KB
and MS tech support as well to find out if there is any deviation of this
behavior.  And again, I appeal for more testers, since I only counted three
(myself included) of the entire service overhaul.

If there is no objection, I'm leaning twords a -dev release of all these
changes anyway, or at least an announce, on the www.servers.ms-windows
newsgroup to invite testers to beat on it before we release, and report
their results.
 
> There is *no* reason to change this in the 1.3 tree unless you have
> found a situation where it is broken.

Please refer to the PR, although I grant it was a Win9x issue that is
resolved by the first aspect of the test

+    if (!isWindowsNT() [...]

> The AllocConsole test has been used for over a year, since 1.3.9,
> and I have not seen the first instance where it failed.

Two cases, and not hypthoetical...

1) The service control code spawn, if one tells the child to run
   detached (-not- for consideration as a patch to the 1.3.x base,
   but as my own experiments for the 2.0 direction.)

2) A program spawning Apache without a console window.

The second case, which applies to the PR, the user wishes to spawn
apache without a console.  He chooses to trap the stderr output and
redirect it (presumably to a Windows-style window console.)  While
he is requesting this for a 9x app, I see no reason that his 
requested behavior should not perform as expected under NT.
I see no reason not to allow this behavior.

I am entirely agreeable to pulling the patch (but retaining the test
for isWindowsNT()) if we do not hear from a significant group of
testers.

I'd also point out that the -ONLY- confirmation (actual beat-it-up
tests) that 2000 even works that I've come across are from our two 
recent testers.  Further, Apache is still beta quality, and 2000 
has not been beaten up enough to make this a make or break issue.
We could go back, of course, to actually opening the SCM to find
out if we are a service.

Lastly, my most KEY concern is the stable release of 2.0.  I am very
confident that this test will be consistent.  I do not have that
confidence in the prior test, nor do I think the wasted resources 
were appropriate (spawn the console stuff just to find out if we are
a service?  Why not call the SCM?)  But I really, really want to 
know in the 1.3.x release that the 2.0 release will be golden.

Further thoughts?

Bill

> -----Original Message-----
> From: wrowe@locus.apache.org [mailto:wrowe@locus.apache.org]
> Sent: Thursday, June 15, 2000 3:41 PM
> To: apache-1.3-cvs@apache.org
> Subject: cvs commit: apache-1.3/src/os/win32 service.c
> 
> 
> wrowe       00/06/15 12:41:23
> 
>   Modified:    src      CHANGES
>                src/os/win32 service.c
>   Log:
>     A newer hack to determine if we're running as a service 
> without waiting
>     for the SCM to fail; Testing both for isWindowsNT and the 
> obscure but
>     consistent flag STARTF_FORCEOFFFEEDBACK.
> 
>     William Rowe with great hints from Kevin Kiley <TOKILEY@aol.com>
> 
>   PR:		5657
>   Submitted by:	Jim Patterson <jim-patterson@ncf.ca>,
> 
>   Revision  Changes    Path
>   1.1559    +6 -0      apache-1.3/src/CHANGES
> 
>   Index: CHANGES
>   ===================================================================
>   RCS file: /home/cvs/apache-1.3/src/CHANGES,v
>   retrieving revision 1.1558
>   retrieving revision 1.1559
>   diff -u -r1.1558 -r1.1559
>   --- CHANGES	2000/06/15 19:18:19	1.1558
>   +++ CHANGES	2000/06/15 19:41:17	1.1559
>   @@ -1,5 +1,11 @@
>    Changes with Apache 1.3.13
> 
>   +  *) Change Win32 the isProcessService() routine to 
> compensate for other
>   +     helper apps that invoke Apache.exe without a console. 
>  Recognize
> that
>   +     we are running NT, and use the 
> STARTF_FORCEOFFFEEDBACK flag to be
>   +     sure that the SCM has invoked the process. [William Rowe,
>   +       Jim Patterson <jim-patterson@ncf.ca>, Kevin Kiley,
> TOKILEY@aol.com]
>   +
>      *) Export from Win32 the ap_start_shutdown and 
> ap_start_restart symbols
>         for modules and executables dynamically linked to the core.
>         [William Rowe; Jim Patterson <jim-patterson@ncf.ca>]
> 
> 
> 
>   1.22      +17 -3     apache-1.3/src/os/win32/service.c
> 
>   Index: service.c
>   ===================================================================
>   RCS file: /home/cvs/apache-1.3/src/os/win32/service.c,v
>   retrieving revision 1.21
>   retrieving revision 1.22
>   diff -u -r1.21 -r1.22
>   --- service.c	2000/06/12 21:49:57	1.21
>   +++ service.c	2000/06/15 19:41:22	1.22
>   @@ -554,13 +554,27 @@
>    }
> 
>    /* A hack to determine if we're running as a service 
> without waiting for
>   - * the SCM to fail; if AllocConsole succeeds, we're a service.
>   + * the SCM to fail; note that you CANNOT start Apache 
> under NT with the
>   + * STARTF_FORCEOFFFEEDBACK argument, since this _will_ 
> cause Apache to
>   + * believe it was started by the win32 Service Control Manager.
>   + *
>   + * This is tested under NT 4.0 both with, and without the 
> "Allow Service
>   + * to Interact With Desktop" option selected, from the 
> Service Control
>   + * applet, the NET START and apache -k start command, and 
> appears very
>   + * consistent.  It's no worse than the earlier hack, which 
> is faulty when
>   + * created without a console by a user process :)  It is 
> certainly far
>   + * faster and less resource intensive than the 
> Alloc/Destroy console
> test.
>   + * Testing for the si.lpDesktop is far less effective, 
> since Apache is
>   + * passed a desktop name with the "Allow Service to Interact With
> Desktop"
>   + * option toggled to true.
>     */
> 
>    BOOL isProcessService() {
>   -    if( !AllocConsole() )
>   +    STARTUPINFO si;
>   +    si.cb = sizeof(si);
>   +    GetStartupInfo(&si);
>   +    if (!isWindowsNT() || !(si.dwFlags & STARTF_FORCEOFFFEEDBACK))
>            return FALSE;
>   -    FreeConsole();
>        return TRUE;
>    }
> 
> 
> 
> 
> 

Mime
View raw message