From: Jeff Trawick Date: Fri, 5 Apr 2002 00:18:14 +0000 (+0000) Subject: worker MPM: add -DFOREGROUND option to use when you want X-Git-Tag: 2.0.35~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=20a1bf68624257b860acc3ec669e3a2d63688623;p=apache worker MPM: add -DFOREGROUND option to use when you want the parent process to run in the foreground (NO_DETACH is a special mode for running under programs like daemontools) the existing flag -DDEBUG turns on FOREGROUND now instead of NO_DETACH git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94441 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 39fb332b5e..bc0ca9221a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with Apache 2.0.35 + *) worker and prefork MPMs: Add -DFOREGROUND switch to cause the + Apache parent process to run in the foreground (similar to -DNO_DETACH + except that it doesn't switch session ids). [Jeff Trawick] + *) Added support for Posix semaphore mutex locking (AcceptMutex posixsem) for those platforms that support it. If using the default implementation, this is between pthread and sysvsem in priority. diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c index f3a858b0bb..7e8354825d 100644 --- a/server/mpm/worker/worker.c +++ b/server/mpm/worker/worker.c @@ -1765,7 +1765,7 @@ static int worker_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp) { static int restart_num = 0; - int no_detach, debug; + int no_detach, debug, foreground; ap_directive_t *pdir; ap_directive_t *max_clients = NULL; apr_status_t rv; @@ -1809,18 +1809,19 @@ static int worker_pre_config(apr_pool_t *pconf, apr_pool_t *plog, debug = ap_exists_config_define("DEBUG"); if (debug) { - no_detach = one_process = 1; + foreground = one_process = 1; } else { one_process = ap_exists_config_define("ONE_PROCESS"); no_detach = ap_exists_config_define("NO_DETACH"); + foreground = ap_exists_config_define("FOREGROUND"); } /* sigh, want this only the second time around */ if (restart_num++ == 1) { is_graceful = 0; - if (!one_process) { + if (!one_process && !foreground) { rv = apr_proc_detach(no_detach ? APR_PROC_DETACH_FOREGROUND : APR_PROC_DETACH_DAEMONIZE); if (rv != APR_SUCCESS) {