Stas Bekman wrote:

>Steve Hay wrote:
>  
>
>>Hi,
>>
>>I've just tried out Apache-Test 1.08 (on Win32) and noticed that when I 
>>ran its test suite with Apache 1.3.29 I was left with an Apache.exe 
>>process running afterwards.
>>
>>I think I've seen this happen before, but never got round to looking at 
>>it.  Having now looked closer at the command-line being used to kick off 
>>the server, it seems to be wrong:
>>
>>    C:/apache/apache.exe -d C:/Temp/Apache-Test-1.08/t -f 
>>C:/Temp/Apache-Test-1.08/t/conf/httpd.conf -DAPACHE1 -X
>>
>>The problem is that there is no space between the "-D" and the 
>>"APACHE1".  That probably causes the "-X" to be ignored, hence two 
>>Apache.exe processes get kicked off, and only one gets killed later.  
>>(The "-X", of course, was to avoid that situation.)
>>    
>>
>
>What's exactly the problem, Steve? You mean Apache 1's parses '-DAPACHE1 -X' 
>as -DAPACHE1=-X?
>
Not sure, but here's what I get using Apache/1.3.29:

apache.exe
starts up two apache.exe's (parent & child)

apache.exe -X
starts up one apache.exe (single process mode)

apache.exe -D APACHE1 -X
starts up one apache.exe

apache.exe -DAPACHE1 -X
starts up two apache.exe's!

Clearly it needs the space between -D and APACHE1 or else it doesn't see 
the -X (or sees it wrongly), and doesn't start up in single process 
mode.  Then Apache-Test, of course, leaves an apache.exe running when 
its done.

I've just tried Apache/2.0.48 now, and that doesn't seem to have the 
problem -- i.e. "apache.exe -DAPACHE2 -X" does do single process mode.

A bug in Apache/1.3.29, maybe?

>
>  
>
>>The attached patch corrects this error (which was repeated in various 
>>places!), and fixes my problem with an Apache.exe being left behind.
>>    
>>
>
>I don't like that solution, as it's very confusing when you are used to -DFoo. 
>I need to understand first why do you get this problem. May be on Win32 it 
>wants '-DAPACHE1=' ? Or if this is something special to -X we could orrange to 
>make it come first.
>
I tried "apache.exe -DAPACHE1= -X", and that starts two processes too :(

I also tried "apache.exe -X -DAPACHE1" and got this error:

    Error in argument 2, char 2: no argument for option D

Running "apache.exe -X -D APACHE1" works OK, though.

>
>  
>
>>Both Apache1 and Apache2 require the space, btw, so the patch works fine 
>>for my Apache 2 setup as well.
>>    
>>
>
>Any pointers to that 'require the space' note?
>
OK, that wasn't strictly true, as I've now found that Apache 2 is OK 
without the space ;)  What I meant was that the usage message printed by 
"apache.exe -h" for both Apache 1 and Apache 2 shows a space:-

Usage: apache [-D name] [-d directory] [-f file] [-n service]
              [-C "directive"] [-c "directive"] [-k signal]
              [-v] [-V] [-h] [-l] [-L] [-S] [-t] [-T]
  -D name          : define a name for use in <IfDefine name> directives
  [...]

To me, this is quite natural since all the other options (-d, -f, -n, 
etc...) also have a space between the option letter and the argument.  
Is that not normal usage for "getopt()"-style arguments anyway?  I've 
never typed "-DFoo" when I meant "-D Foo" ;)

- Steve



------------------------------------------------
Radan Computational Ltd.

The information contained in this message and any files transmitted with it are 
confidential and intended for the addressee(s) only.  If you have received this 
message in error or there are any problems, please notify the sender immediately.  The 
unauthorized use, disclosure, copying or alteration of this message is strictly 
forbidden.  Note that any views or opinions presented in this email are solely those 
of the author and do not necessarily represent those of Radan Computational Ltd.  The 
recipient(s) of this message should check it and any attached files for viruses: Radan 
Computational will accept no liability for any damage caused by any virus transmitted 
by this email.


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

Reply via email to