httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Q Beukes <apache-...@list.za.net>
Subject Apache STOP Code
Date Thu, 12 Jul 2007 06:30:42 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hey,<br>
<br>
Is there any reason why the following switch for the "httpd" binary
wouldn't be appropriate/accepted:<br>
One such as "--no-stopreturn" (or something), which waits after sending
TERM for the httpd process to die before it returns to the shell.<br>
<br>
One more question. Is there any code in the shutdown procedure that can
cause a shutdown to fail and abort?<br>
<br>
Q Beukes<br>
<br>
Q Beukes wrote:
<blockquote cite="mid4691E631.1060501@list.za.net" type="cite">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
Thanks for your quick response. <br>
  <br>
Nick Kew wrote:<br>
  <blockquote cite="mid20070708203623.121b962d@grimnir" type="cite">
    <pre wrap="">  </pre>
    <blockquote type="cite">
      <pre wrap="">To restart the process you need to send a HUP signal. This works
fine,
but what if you want to stop the server for a moment and then start it
again, perhaps doing something in the mean while. This cannot be
automated unless you watch the process/PID in some way.
    </pre>
    </blockquote>
    <pre wrap=""><!---->
You could send it SIGKILL and take the consequences.  Not that I'd
recommend that!  There are various techniques you can use for
scripting a shutdown: for example, polling it.

  </pre>
  </blockquote>
With polling it I figure you just mean something along the lines of a
"kill -0" to see if it's still running. So is there (when sending a
TERM signal) some shutdown processes that can fail and cause Apache to
abort the shutdown?<br>
  <blockquote cite="mid20070708203623.121b962d@grimnir" type="cite">
    <blockquote type="cite">
      <pre wrap="">This is fine for most purposes, but what if you want to stop what
you're doing in case the shutdown fails. If the "httpd" binary would
return a non-negative exit code
    </pre>
    </blockquote>
    <pre wrap=""><!---->
Return a code to whom?
  </pre>
  </blockquote>
Basically like "if ! httpd -k stop; then --failed--; fi".<br>
  <blockquote cite="mid20070708203623.121b962d@grimnir" type="cite">
    <blockquote type="cite">
      <pre wrap="">These are just some issues people have. Some people feel it's a bad
design.
    </pre>
    </blockquote>
    <pre wrap=""><!---->
Why?
  </pre>
  </blockquote>
Simply because you can't determine for certain if the shutdown was
successful or not, and to restart apache you have to rely on the
restart signal or uncertain timeouts.<br>
  <blockquote cite="mid20070708203623.121b962d@grimnir" type="cite">
    <blockquote type="cite">
      <pre wrap="">	 Some people (like me) are not so sure what the idea behind it
is.
    </pre>
    </blockquote>
    <pre wrap=""><!---->
To give the workers time to finish serving current requests rather
than aborting them.
  </pre>
  </blockquote>
  <pre wrap="">I understand this yes. This question was more along the lines of whether
or not there is a reason one just sends and waits, or not IPC which returns only later or
any one of the methods daemons can use to shutdown. </pre>
  <blockquote cite="mid20070708203623.121b962d@grimnir" type="cite">
    <pre wrap="">We're open to patches if you have a better design.
  </pre>
  </blockquote>
  <pre wrap="">The design seems fine. Perhaps just some mechanism to track the shutdown?
Or a command line switch to block the process until shutdown completed? With some guidance
and advice I would be more than willing to implement something.

Q Beukes

  </pre>
</blockquote>
<br>
</body>
</html>

Mime
View raw message