From ab0d82ccf23fb3904c8d52eeea7a6a885f69df71 Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Fri, 26 Aug 2005 16:11:45 +0000 Subject: [PATCH] Documentation changes relevant to new graceful-stop command line argument for httpd and apachectl, and the the "GracefulShutdownTimeout" directive. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@240271 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/mpm_common.xml | 20 ++++++++++++++++++++ docs/manual/programs/apachectl.xml | 7 +++++++ docs/manual/programs/httpd.xml | 5 +++-- docs/manual/stopping.xml | 27 ++++++++++++++++++++++++++- 4 files changed, 56 insertions(+), 3 deletions(-) diff --git a/docs/manual/mod/mpm_common.xml b/docs/manual/mod/mpm_common.xml index 1aefd752df..17daf039c4 100644 --- a/docs/manual/mod/mpm_common.xml +++ b/docs/manual/mod/mpm_common.xml @@ -156,6 +156,26 @@ after a crash + +GracefulShutdownTimeout +Specify a timeout after which a gracefully shutdown server +will exit. +GracefulShutDownTimeout seconds +GracefulShutDownTimeout 0 +server config +prefork +Available in version 2.4 and later + + +

The GracefulShutdownTimeout specifies + how many seconds after receiving a "graceful-stop" signal, a + server should continue to run, handling the existing connections.

+ +

Setting this value to zero means that the server will wait + indefinitely until all remaining requests have been fully served.

+
+
+ Group Group under which the server will answer diff --git a/docs/manual/programs/apachectl.xml b/docs/manual/programs/apachectl.xml index 8307ea73e3..2270620f21 100644 --- a/docs/manual/programs/apachectl.xml +++ b/docs/manual/programs/apachectl.xml @@ -125,6 +125,13 @@ files as in configtest before initiating the restart to make sure Apache doesn't die. This is equivalent to apachectl -k graceful. +
graceful-stop
+ +
Gracefully stops the Apache httpd daemon. +This differs from a normal stop in that currently open connections are not +aborted. A side effect is that old log files will not be closed immediately. +This is equivalent to apachectl -k graceful-stop.
+
configtest
Run a configuration file syntax test. It parses the configuration diff --git a/docs/manual/programs/httpd.xml b/docs/manual/programs/httpd.xml index 4710eaf19b..1c5234efec 100644 --- a/docs/manual/programs/httpd.xml +++ b/docs/manual/programs/httpd.xml @@ -51,7 +51,8 @@ [ -C directive ] [ -c directive ] [ -D parameter ] [ -e level ] [ -E - file ] [ -k start|restart|graceful|stop ] + file ] + [ -k start|restart|graceful|stop|graceful-stop ] [ -R directory ] [ -h ] [ -l ] [ -L ] [ -S ] [ -t ] [ -v ] [ -V ] @@ -84,7 +85,7 @@ path relative to the ServerRoot. The default is conf/httpd.conf.
-
-k start|restart|graceful|stop
+
-k start|restart|graceful|stop|graceful-stop
Signals httpd to start, restart, or stop. See Stopping Apache for more information.
diff --git a/docs/manual/stopping.xml b/docs/manual/stopping.xml index cc2057e307..d3798f65d8 100644 --- a/docs/manual/stopping.xml +++ b/docs/manual/stopping.xml @@ -61,7 +61,7 @@

The second method of signaling the httpd processes is to use the -k command line options: stop, - restart, and graceful, + restart, graceful and graceful-stop, as described below. These are arguments to the httpd binary, but we recommend that you send them using the apachectl control script, which @@ -181,6 +181,31 @@ restart then your parent will not restart, it will exit with an error. See above for a method of avoiding this. +

Graceful Stop + +
Signal: WINCH
+
apachectl -k graceful-stop
+
+ +

The WINCH or graceful-stop signal causes + the parent process to advise the children to exit after + their current request (or to exit immediately if they're not + serving anything). The parent will then remove it's PidFile and cease listening on + all ports. The parent will continue to run, and monitor children + which are handling requests. Once all children have finalised + and exited or the timeout specified by the GracefulShutdownTimeout has been + reached, the parent will also exit.

+ +

A TERM signal will immediately terminate the + parent process and all children when in the "graceful" state. However + as the PidFile will + have been removed, you will not be able to use + apachectl or httpd to send this signal,

+
+ +
Appendix: signals and race conditions

Prior to Apache 1.2b9 there were several race -- 2.40.0