httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Q Beukes <apache-...@list.za.net>
Subject Re: Apache Service Control
Date Mon, 09 Jul 2007 07:39:29 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">
</head>
<body bgcolor="#ffffff" text="#000000">
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">
  <pre wrap=""></pre>
  <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">
  <pre wrap=""></pre>
  <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>
</body>
</html>

Mime
View raw message