From 7343783f292bdb8e015f18cf0e97c92a38618b71 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 3 Apr 2002 13:45:57 +0000 Subject: [PATCH] prefork 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@94419 13f79535-47bb-0310-9956-ffa450edef68 --- server/mpm/prefork/prefork.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index 2c75ff0cf1..1aaf055117 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -1194,24 +1194,26 @@ static int prefork_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, static int prefork_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; apr_status_t rv; debug = ap_exists_config_define("DEBUG"); - if (debug) - no_detach = one_process = 1; + if (debug) { + foreground = one_process = 1; + } else { no_detach = ap_exists_config_define("NO_DETACH"); one_process = ap_exists_config_define("ONE_PROCESS"); + 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) { -- 2.40.0