<p>Modify those examples to match your <code class="directive"><a href="./mod/core.html#serverroot">ServerRoot</a></code> and <code class="directive"><a href="./mod/mpm_common.html#pidfile">PidFile</a></code> settings.</p>
<p>The <code>USR1</code> or <code>graceful</code> signal causes
the parent process to <em>advise</em> the children to exit after
their current request (or to exit immediately if they're not
serving anything). The parent re-reads its configuration files and
re-opens its log files. As each child dies off the parent replaces
it with a child from the new <em>generation</em> of the
configuration, which begins serving new requests immediately.</p>
<div class="note">On certain platforms that do not allow <code>USR1</code> to
be used for a graceful restart, an alternative signal may be used (such
as <code>WINCH</code>). The command <code>apachectl graceful</code>
will send the right signal for your platform.</div>
<p>This code is designed to always respect the process control
directive of the MPMs, so the number of processes and threads
available to serve clients will be maintained at the appropriate
values throughout the restart process. Furthermore, it respects
<code class="directive"><a href="./mod/mpm_common.html#startservers">StartServers</a></code> in the
following manner: if after one second at least <code class="directive"><a href="./mod/mpm_common.html#startservers">StartServers</a></code> new children have not
been created, then create enough to pick up the slack. Hence the
code tries to maintain both the number of children appropriate for
the current load on the server, and respect your wishes with the
<h2><a name="race" id="race">Appendix: signals and race conditions</a></h2>
<p>Prior to Apache 1.2b9 there were several <em>race
conditions</em> involving the restart and die signals (a simple
description of race condition is: a time-sensitive problem, as
in if something happens at just the wrong time it won't behave
as expected). For those architectures that have the "right"
feature set we have eliminated as many as we can. But it should
be noted that there still do exist race conditions on certain
architectures.</p>
<p>Architectures that use an on disk <code class="directive"><a href="./mod/mpm_common.html#scoreboardfile">ScoreBoardFile</a></code> have the potential
to corrupt their scoreboards. This can result in the "bind:
Address already in use" (after <code>HUP</code>) or "long lost
child came home!" (after <code>USR1</code>). The former is a fatal
error, while the latter just causes the server to lose a
scoreboard slot. So it might be advisable to use graceful
restarts, with an occasional hard restart. These problems are very
difficult to work around, but fortunately most architectures do
not require a scoreboard file. See the <code class="directive"><a href="./mod/mpm_common.html#scoreboardfile">ScoreBoardFile</a></code> documentation for a
architecture uses it.</p>
<p>All architectures have a small race condition in each child
involving the second and subsequent requests on a persistent
HTTP connection (KeepAlive). It may exit after reading the
request line but before reading any of the request headers.
There is a fix that was discovered too late to make 1.2. In
theory this isn't an issue because the KeepAlive client has to
expect these events because of network latencies and server
timeouts. In practice it doesn't seem to affect anything either
-- in a test case the server was restarted twenty times per
second and clients successfully browsed the site without
getting broken images or empty documents. </p>
</div></div>
<div id="footer">
<p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</a></p>