]> granicus.if.org Git - apache/commitdiff
prefork MPM: add -DFOREGROUND option to use when you want
authorJeff Trawick <trawick@apache.org>
Wed, 3 Apr 2002 13:45:57 +0000 (13:45 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 3 Apr 2002 13:45:57 +0000 (13:45 +0000)
             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

index 2c75ff0cf1344e2b4d4fcb77226e39d42315778d..1aaf0551171d8d03fbf54af249de9348937ae806 100644 (file)
@@ -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) {