From: Jeff Trawick Date: Fri, 5 Apr 2002 00:34:22 +0000 (+0000) Subject: implement FOREGROUND for perchild and beos MPMs too X-Git-Tag: 2.0.35~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f396cfdbc53d183eb09b68fb83a95d2c06e12c8;p=apache implement FOREGROUND for perchild and beos MPMs too git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94442 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index bc0ca9221a..caf158651e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,8 +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] + *) worker, prefork, perchild, beos 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 diff --git a/server/mpm/beos/beos.c b/server/mpm/beos/beos.c index 9df32c06e3..d6e4d72fd0 100644 --- a/server/mpm/beos/beos.c +++ b/server/mpm/beos/beos.c @@ -1000,24 +1000,26 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) static int beos_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; apr_status_t rv; debug = ap_exists_config_define("DEBUG"); - if (debug) - no_detach = one_process = 1; + if (debug) { + 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) { diff --git a/server/mpm/experimental/perchild/perchild.c b/server/mpm/experimental/perchild/perchild.c index b6b0ed7c27..c41afc3acb 100644 --- a/server/mpm/experimental/perchild/perchild.c +++ b/server/mpm/experimental/perchild/perchild.c @@ -1454,7 +1454,7 @@ static int perchild_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp static int perchild_pre_config(apr_pool_t *p, 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; int i; int tmp_server_limit = DEFAULT_SERVER_LIMIT; @@ -1464,18 +1464,19 @@ static int perchild_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptem 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) { diff --git a/server/mpm/perchild/perchild.c b/server/mpm/perchild/perchild.c index b6b0ed7c27..c41afc3acb 100644 --- a/server/mpm/perchild/perchild.c +++ b/server/mpm/perchild/perchild.c @@ -1454,7 +1454,7 @@ static int perchild_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp static int perchild_pre_config(apr_pool_t *p, 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; int i; int tmp_server_limit = DEFAULT_SERVER_LIMIT; @@ -1464,18 +1464,19 @@ static int perchild_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptem 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) {