]> granicus.if.org Git - apache/commitdiff
The prefork and OS/2 MPMs are overwriting the pid file when a second copy
authorPaul J. Reder <rederpj@apache.org>
Mon, 20 Aug 2001 19:47:52 +0000 (19:47 +0000)
committerPaul J. Reder <rederpj@apache.org>
Mon, 20 Aug 2001 19:47:52 +0000 (19:47 +0000)
of httpd is started and shuts down due to socket conflict. Moving the
call to ap_log_pid solves the problem.

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

CHANGES
server/mpm/mpmt_os2/mpmt_os2.c
server/mpm/prefork/prefork.c
server/mpm/spmt_os2/spmt_os2.c

diff --git a/CHANGES b/CHANGES
index 1c608ac7156dcf30333b9865c420080ff677083e..5df73e87676ee9a20f2dd7226b71eedc4c380e1e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
 Changes with Apache 2.0.25-dev
 
+  *) The prefork and OS/2 MPMs are overwriting the pid file when a second copy
+     of httpd is started and shuts down due to socket conflict. Moving the
+     call to ap_log_pid solves the problem.
+
   *) Changed the late-1.3 log_config substitution %c to %X, to log the
      status of the closed connection, as it conflicts with the far more
      common, historical ssl logging directive %...{var}c.  [William Rowe]
index 10802514377e88c8c005e2a2f09b5040eb1ece1a..edfce5c6a618be96eda6d6b6cb1ebb00ba1d5766 100644 (file)
@@ -193,7 +193,6 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s )
         /* Parent process */
         char restart;
         is_parent_process = TRUE;
-        ap_log_pid(pconf, ap_pid_fname);
 
         if (ap_setup_listeners(ap_server_conf) < 1) {
             ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, 0, s,
@@ -201,6 +200,8 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s )
             return 1;
         }
 
+        ap_log_pid(pconf, ap_pid_fname);
+
         restart = master_main();
         ++ap_my_generation;
         ap_scoreboard_image->global.running_generation = ap_my_generation;
index 9c35747366771a10b085a1221a0c8817d8cf933e..4e7476e30b493e49dc9c666a07fb364c5317ee53 100644 (file)
@@ -1110,12 +1110,13 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
 
     ap_server_conf = s;
  
-    ap_log_pid(pconf, ap_pid_fname);
-
     if (setup_listeners(s)) {
        /* XXX: hey, what's the right way for the mpm to indicate a fatal error? */
        return 1;
     }
+
+    ap_log_pid(pconf, ap_pid_fname);
+
     if ((rv = ap_mpm_pod_open(pconf, &pod))) {
         ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
                "Could not open pipe-of-death.");
index f07ebb1b0a4f0709f98c093883470bd4bccb1961..dd4a4abe245a1765d50912ed9303f41ce7116c15 100644 (file)
@@ -926,7 +926,6 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
 
     pconf = _pconf;
     ap_server_conf = s;
-    ap_log_pid(pconf, ap_pid_fname);
 
     if ((status = ap_listen_open(s->process, s->port)) != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, status, s,
@@ -934,6 +933,8 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
        return -1;
     }
 
+    ap_log_pid(pconf, ap_pid_fname);
+
     SAFE_ACCEPT(accept_mutex_init(pconf));
 
     if (!is_graceful) {