Re: [EMAIL PROTECTED] CGI receives SIGTERM

2006-10-18 Thread Steve Swift
We will just have to agree to disagree. Over many releases of Apache I've never seen a looping or hung CGI sent a SIGTERM. I've even asked in this group how that could be achieved, only to be told that it cannot be done, using facilities within apache alone.
On 17/10/06, Ravi Menon [EMAIL PROTECTED] wrote:
Actually it is more subtle. Even during execution, apache starts the timerduring start of header, and start of body. So a malicious script couldpotentiallygive data in trickles to restart these timers, but my point was that apache
definetly takes care of runaway cgi scripts even in execution (as longas it doesn't trick the server as mentioned above).BTW I did not have any issues - I was just responding to the originalcomment that apache does not handle runaway scripts which is not true.
RaviOn 10/17/06, Steve Swift [EMAIL PROTECTED] wrote: Ah, that's different - your timeout is occurring trying to read your CGI script - it is not getting to execution.
 I've never had this problem, so I cannot help you Steve Swift http://www.swiftys.org.uk -
 The official User-To-User support forum of the Apache HTTP Server Project. See URL:http://httpd.apache.org/userslist.html for more info. To unsubscribe, e-mail: 
[EMAIL PROTECTED] from the digest: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]-The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.To unsubscribe, e-mail: [EMAIL PROTECTED]
  from the digest: [EMAIL PROTECTED]For additional commands, e-mail: 
[EMAIL PROTECTED]-- Steve Swifthttp://www.swiftys.org.uk


Re: [EMAIL PROTECTED] CGI receives SIGTERM

2006-10-17 Thread Ravi Menon

I repeated a similar test on my apache 1.3.33 and it works - I see the
following lines in the error_log during timeout:

read script header timed out

Confirmed with ps that the script is actually killed. Also confirmed
from the sources on where this error_log line originates from -
ap_script_scan_header_core() ..leading to here from a sequence of
calls from mod_cgi.so ; the first attempt to read headers from the cgi
app.

Repeated the test in apache 2.2.0 (with mpm prefork) and I get a
similar output during timeout:

.Timeout waiting for output from CGI script .

As per 1.3.33 sources, if SIGTERM fails, it even tries SIGKILL (9).

Ravi





On 10/14/06, Steve Swift [EMAIL PROTECTED] wrote:

Well, I wrote a timeout CGI especially to go into a loop. It's still
running after 720 seconds on my 2.0.46+ server under linux.  Timeout is set
to 300.
I never saw looping CGI's terminated under version 1 either.
With four processors in our system we sometimes don't notice looping CGI
scripts for a few days!


On 13/10/06, Ravi Menon  [EMAIL PROTECTED] wrote:
 In the apache 1.3.x on Linux that I am using, apache does send a SIGTERM
 when the Timeout value has reached.  The code is here:

 apache_1.3.33/src/main/alloc.c:free_proc_chain()

 This is called from ap_clear_pool() which is done at the end of
 request cycle, or
 during hard timeouts.

 The logic here also covers runaway cgi apps.

 Didn't confirm if the same exists in apache 2x but I would be
 surprised if this functionality was removed.

 Ravi



 On 10/11/06, Steve Swift  [EMAIL PROTECTED] wrote:
  As far as I know Apache doesn't send Sigterm to a running CGI. This has
  nothing to do with the Timeout directive.
  A couple of weeks ago I asked the opposite question: How can I timeout
a
  CGI that is hung/looping? and the answer I got, from trusted sources
was
  that it cannot be done with Apache alone, but would require an external
  monitor.
 
  Something else on your system is doing this.
 
  On 11/10/06, Nguyen, Nguyen Vu [EMAIL PROTECTED]  wrote:
   Hi guys,
  
   As far as I know the Timeout directive does control the amount of time
a
  CGI
   has before receiving a SIGTERM. However my CGI still receives a
SIGTERM
   after what appears to be a random amount of time that is much less
than
  what
   I have set in the Timeout directive. The client side still has the
   connection to the CGI when it receives the SIGTERM. So I'm wondering
under
   what other circumstances does apache send SIGTERM to a CGI? Any help
is
  very
   much appreciated.
  
   Thanks.
  
  
  
 
-
   The official User-To-User support forum of the Apache HTTP Server
Project.
   See URL:http://httpd.apache.org/userslist.html for
more
  info.
   To unsubscribe, e-mail:
  [EMAIL PROTECTED]
 from the digest:
  [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
 
  --
  Steve Swift
   http://www.swiftys.org.uk


-
 The official User-To-User support forum of the Apache HTTP Server Project.
 See URL: http://httpd.apache.org/userslist.html for
more info.
 To unsubscribe, e-mail:
[EMAIL PROTECTED]
   from the digest:
[EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





--
Steve Swift
http://www.swiftys.org.uk


-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
 from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [EMAIL PROTECTED] CGI receives SIGTERM

2006-10-17 Thread Steve Swift
Ah, that's different - your timeout is occurring trying to read your CGI
script - it is not getting to execution. 
I've never had this problem, so I cannot help you

Steve Swift
http://www.swiftys.org.uk


-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
  from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [EMAIL PROTECTED] CGI receives SIGTERM

2006-10-17 Thread Ravi Menon

Actually it is more subtle. Even during execution, apache starts the timer
during start of header, and start of body. So a malicious script could
potentially
give data in trickles to restart these timers, but my point was that apache
definetly takes care of runaway cgi scripts even in execution (as long
as it doesn't trick the server as mentioned above).

BTW I did not have any issues - I was just responding to the original
comment that apache does not handle runaway scripts which is not true.

Ravi


On 10/17/06, Steve Swift [EMAIL PROTECTED] wrote:

Ah, that's different - your timeout is occurring trying to read your CGI
script - it is not getting to execution.
I've never had this problem, so I cannot help you

Steve Swift
http://www.swiftys.org.uk


-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
  from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
 from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [EMAIL PROTECTED] CGI receives SIGTERM

2006-10-14 Thread Steve Swift
Well, I wrote a timeout CGI especially to go into a loop. It's still running after 720 seconds on my 2.0.46+ server under linux. Timeout is set to 300.I never saw looping CGI's terminated under version 1 either.
With four processors in our system we sometimes don't notice looping CGI scripts for a few days!On 13/10/06, Ravi Menon 
[EMAIL PROTECTED] wrote:In the apache 1.3.x on Linux that I am using, apache does send a SIGTERM
when the Timeout value has reached.The code is here:apache_1.3.33/src/main/alloc.c:free_proc_chain()This is called from ap_clear_pool() which is done at the end ofrequest cycle, orduring hard timeouts.
The logic here also covers runaway cgi apps.Didn't confirm if the same exists in apache 2x but I would besurprised if this functionality was removed.RaviOn 10/11/06, Steve Swift 
[EMAIL PROTECTED] wrote: As far as I know Apache doesn't send Sigterm to a running CGI. This has nothing to do with the Timeout directive. A couple of weeks ago I asked the opposite question: How can I timeout a
 CGI that is hung/looping? and the answer I got, from trusted sources was that it cannot be done with Apache alone, but would require an external monitor. Something else on your system is doing this.
 On 11/10/06, Nguyen, Nguyen Vu [EMAIL PROTECTED]  wrote:  Hi guys,   As far as I know the Timeout directive does control the amount of time a
 CGI  has before receiving a SIGTERM. However my CGI still receives a SIGTERM  after what appears to be a random amount of time that is much less than what  I have set in the Timeout directive. The client side still has the
  connection to the CGI when it receives the SIGTERM. So I'm wondering under  what other circumstances does apache send SIGTERM to a CGI? Any help is very  much appreciated.
   Thanks.-  The official User-To-User support forum of the Apache HTTP Server Project.
  See URL:http://httpd.apache.org/userslist.html for more info.  To unsubscribe, e-mail: 
[EMAIL PROTECTED]  from the digest: [EMAIL PROTECTED]  For additional commands, e-mail: 
[EMAIL PROTECTED]   -- Steve Swifthttp://www.swiftys.org.uk
-The official User-To-User support forum of the Apache HTTP Server Project.See URL:
http://httpd.apache.org/userslist.html for more info.To unsubscribe, e-mail: [EMAIL PROTECTED]  from the digest: 
[EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]-- Steve Swift
http://www.swiftys.org.uk


Re: [EMAIL PROTECTED] CGI receives SIGTERM

2006-10-13 Thread Ravi Menon

In the apache 1.3.x on Linux that I am using, apache does send a SIGTERM
when the Timeout value has reached.  The code is here:

apache_1.3.33/src/main/alloc.c:free_proc_chain()

This is called from ap_clear_pool() which is done at the end of
request cycle, or
during hard timeouts.

The logic here also covers runaway cgi apps.

Didn't confirm if the same exists in apache 2x but I would be
surprised if this functionality was removed.

Ravi



On 10/11/06, Steve Swift [EMAIL PROTECTED] wrote:

As far as I know Apache doesn't send Sigterm to a running CGI. This has
nothing to do with the Timeout directive.
A couple of weeks ago I asked the opposite question: How can I timeout a
CGI that is hung/looping? and the answer I got, from trusted sources was
that it cannot be done with Apache alone, but would require an external
monitor.

Something else on your system is doing this.

On 11/10/06, Nguyen, Nguyen Vu [EMAIL PROTECTED]  wrote:
 Hi guys,

 As far as I know the Timeout directive does control the amount of time a
CGI
 has before receiving a SIGTERM. However my CGI still receives a SIGTERM
 after what appears to be a random amount of time that is much less than
what
 I have set in the Timeout directive. The client side still has the
 connection to the CGI when it receives the SIGTERM. So I'm wondering under
 what other circumstances does apache send SIGTERM to a CGI? Any help is
very
 much appreciated.

 Thanks.



-
 The official User-To-User support forum of the Apache HTTP Server Project.
 See URL:http://httpd.apache.org/userslist.html for more
info.
 To unsubscribe, e-mail:
[EMAIL PROTECTED]
   from the digest:
[EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





--
Steve Swift
 http://www.swiftys.org.uk


-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
 from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [EMAIL PROTECTED] CGI receives SIGTERM

2006-10-12 Thread Steve Swift
As far as I know Apache doesn't send Sigterm to a running CGI. This has nothing to do with the Timeout directive.A couple of weeks ago I asked the opposite question: How can I timeout a CGI that is hung/looping? and the answer I got, from trusted sources was that it cannot be done with Apache alone, but would require an external monitor.
Something else on your system is doing this.On 11/10/06, Nguyen, Nguyen Vu [EMAIL PROTECTED]
 wrote:Hi guys,As far as I know the Timeout directive does control the amount of time a CGI
has before receiving a SIGTERM. However my CGI still receives a SIGTERMafter what appears to be a random amount of time that is much less than whatI have set in the Timeout directive. The client side still has the
connection to the CGI when it receives the SIGTERM. So I'm wondering underwhat other circumstances does apache send SIGTERM to a CGI? Any help is verymuch appreciated.Thanks.-
The official User-To-User support forum of the Apache HTTP Server Project.See URL:http://httpd.apache.org/userslist.html for more info.To unsubscribe, e-mail: 
[EMAIL PROTECTED]  from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]-- Steve Swift
http://www.swiftys.org.uk


[EMAIL PROTECTED] CGI receives SIGTERM

2006-10-11 Thread Nguyen, Nguyen Vu
Hi guys,

As far as I know the Timeout directive does control the amount of time a CGI
has before receiving a SIGTERM. However my CGI still receives a SIGTERM
after what appears to be a random amount of time that is much less than what
I have set in the Timeout directive. The client side still has the
connection to the CGI when it receives the SIGTERM. So I'm wondering under
what other circumstances does apache send SIGTERM to a CGI? Any help is very
much appreciated.

Thanks.


-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
  from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]