]> granicus.if.org Git - apache/commitdiff
Merge r1766160 from trunk:
authorJim Jagielski <jim@apache.org>
Fri, 4 Nov 2016 19:02:44 +0000 (19:02 +0000)
committerJim Jagielski <jim@apache.org>
Fri, 4 Nov 2016 19:02:44 +0000 (19:02 +0000)
mpm_unix: Apache fails to start if previously crashed then restarted with
the same PID (e.g. in container).  PR 60261.

Proposed by: Val <valentin.bremond gmail.com>
Reviewed by: ylavic

Submitted by: ylavic
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1768078 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
server/mpm_unix.c

diff --git a/CHANGES b/CHANGES
index 0d6561b6629567e6b65e5f841d077e2df547a366..af16fcc6540d8d28cc83de27d82c72baccc9fef4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@
 
 Changes with Apache 2.4.24
 
+  *) mpm_unix: Apache fails to start if previously crashed then restarted with
+     the same PID (e.g. in container).  PR 60261.
+     [Val <valentin.bremond gmail.com>, Yann Ylavic]
+
   *) mod_http2: unannounced and multiple interim responses (status code < 200)
      are parsed and forwarded to client until a final response arrives.
      [Stefan Eissing]
diff --git a/STATUS b/STATUS
index 9e9490abbbaa1c740fd339f99f0814dfaf6d902c..1ab3c778329263cd3b84fbee60d22435443cee15 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -117,12 +117,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) mpm_unix: Apache fails to start if previously crashed then restarted with
-     the same PID (e.g. in container).  PR 60261.
-     trunk patch: http://svn.apache.org/r1766160
-     2.4.x patch: trunk works (modulo CHANGES)
-     +1: ylavic, jim, covener
-
   *) http: Respond with "408 Request Timeout" when a timeout occurs while
      reading the request body.  PR 60313.
      trunk patch: http://svn.apache.org/r1739201
index 1a7f9359c73b51e0a7dbe178f15114f0464baf7c..7a1185466982165b88afa7e8052a8190e9b5d1b2 100644 (file)
@@ -787,7 +787,10 @@ int ap_signal_server(int *exit_status, apr_pool_t *pconf)
         status = "httpd (no pid file) not running";
     }
     else {
-        if (kill(otherpid, 0) == 0) {
+        /* With containerization, httpd may get the same PID at each startup,
+         * handle it as if it were not running (it obviously can't).
+         */
+        if (otherpid != getpid() && kill(otherpid, 0) == 0) {
             running = 1;
             status = apr_psprintf(pconf,
                                   "httpd (pid %" APR_PID_T_FMT ") already "