]> granicus.if.org Git - apache/commitdiff
implement FOREGROUND for perchild and beos MPMs too
authorJeff Trawick <trawick@apache.org>
Fri, 5 Apr 2002 00:34:22 +0000 (00:34 +0000)
committerJeff Trawick <trawick@apache.org>
Fri, 5 Apr 2002 00:34:22 +0000 (00:34 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94442 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/mpm/beos/beos.c
server/mpm/experimental/perchild/perchild.c
server/mpm/perchild/perchild.c

diff --git a/CHANGES b/CHANGES
index bc0ca9221aa85244e0ae00a255ea0f52f2927a94..caf158651ec42fcc302e0ce49e43d23a98ce6da9 100644 (file)
--- 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
index 9df32c06e39f57440bae705923a79044b799e5ca..d6e4d72fd01e9ddfce1802af263d309dfd4186fb 100644 (file)
@@ -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) {
index b6b0ed7c277bd15da322663b1ef0b51a7df7dd3d..c41afc3acbe8240d16819714e3ddfacb75f5bc88 100644 (file)
@@ -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) {
index b6b0ed7c277bd15da322663b1ef0b51a7df7dd3d..c41afc3acbe8240d16819714e3ddfacb75f5bc88 100644 (file)
@@ -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) {