From: Paul J. Reder Date: Mon, 20 Aug 2001 19:47:52 +0000 (+0000) Subject: The prefork and OS/2 MPMs are overwriting the pid file when a second copy X-Git-Tag: 2.0.25~240 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c8698ef0dbbc7250d1f54caf1cdefe2b7588d691;p=apache 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90418 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 1c608ac715..5df73e8767 100644 --- 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] diff --git a/server/mpm/mpmt_os2/mpmt_os2.c b/server/mpm/mpmt_os2/mpmt_os2.c index 1080251437..edfce5c6a6 100644 --- a/server/mpm/mpmt_os2/mpmt_os2.c +++ b/server/mpm/mpmt_os2/mpmt_os2.c @@ -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; diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index 9c35747366..4e7476e30b 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -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."); diff --git a/server/mpm/spmt_os2/spmt_os2.c b/server/mpm/spmt_os2/spmt_os2.c index f07ebb1b0a..dd4a4abe24 100644 --- a/server/mpm/spmt_os2/spmt_os2.c +++ b/server/mpm/spmt_os2/spmt_os2.c @@ -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) {