]> granicus.if.org Git - apache/commitdiff
mpm_unix: Apache fails to start if previously crashed then restarted with
authorYann Ylavic <ylavic@apache.org>
Fri, 21 Oct 2016 21:44:29 +0000 (21:44 +0000)
committerYann Ylavic <ylavic@apache.org>
Fri, 21 Oct 2016 21:44:29 +0000 (21:44 +0000)
the same PID (e.g. in container).  PR 60261.

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

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1766160 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/mpm_unix.c

diff --git a/CHANGES b/CHANGES
index 4630dc2839a451aa26569ce3421827b058998009..31b0fac848cd31ec962d4ea2a0f874144c2a9c85 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) 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_dav: Fix a potential cause of unbounded memory usage or incorrect
      behavior in a routine that sends <DAV:response>'s to the output filters.
      [Evgeny Kotkov]
index 06318fe4a267f91eb18a176a1a34d80bfcdc3a17..140d4e8f684cc724e66b9b19551a57b8eeefcf17 100644 (file)
@@ -788,7 +788,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 "