]> granicus.if.org Git - apache/commitdiff
Add a NO_DETACH environment variable to all MPMs that understand
authorRyan Bloom <rbb@apache.org>
Tue, 1 Aug 2000 17:36:13 +0000 (17:36 +0000)
committerRyan Bloom <rbb@apache.org>
Tue, 1 Aug 2000 17:36:13 +0000 (17:36 +0000)
ONE_PROCESS.  This allows Apache to start up without detaching from
the controlling terminal, but also not going into single process mode.
The main purpose of this patch is to make it very easy to debug the
child process startup code.
PR: 2144

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85970 13f79535-47bb-0310-9956-ffa450edef68

STATUS
server/mpm/beos/beos.c
server/mpm/dexter/dexter.c
server/mpm/mpmt_beos/mpmt_beos.c
server/mpm/mpmt_pthread/mpmt_pthread.c
server/mpm/prefork/prefork.c

diff --git a/STATUS b/STATUS
index af388617cfb01e054a380a8d1df018f3c00610d1..25f1413a65fa4da62a9425bb15079df0957f4d89 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 Apache 2.0 STATUS:
-Last modified at [$Date: 2000/08/01 17:06:20 $]
+Last modified at [$Date: 2000/08/01 17:36:02 $]
 
 Release:
 
@@ -424,10 +424,6 @@ put them into 'the next release':
       mod_status always displays 256 possible connection slots
        Status: 
 
-    * PR#2144: general
-      apache always detaches for normal operation
-       Status: 
-
     * PR#2221: documentation
       Make online documentation search link back to my installation
        Status: 
index d65a42a869b50a6df36a2533c76d503ff38f8f04..1e8fb63dd053b0dcba717d45a38504173beec06c 100644 (file)
@@ -851,13 +851,15 @@ int ap_mpm_run(ap_pool_t *_pconf, ap_pool_t *plog, server_rec *s)
 static void beos_pre_config(ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptemp)
 {
     static int restart_num = 0;
+    int no_detach = 0;
 
     one_process = !!getenv("ONE_PROCESS");
+    no_detach = !!getenv("NO_DETACH");
 
     /* sigh, want this only the second time around */
     if (restart_num++ == 1) {
         is_graceful = 0;
-        if (!one_process)
+        if (!one_process && !no_detach)
                ap_detach();
         server_pid = getpid();
     }
index e0b8df672f5d18437a52346084e38ca75ea6cb2c..6e4e36875c0a5edec8dedf65e145256d13334d8b 100644 (file)
@@ -1140,14 +1140,16 @@ int ap_mpm_run(ap_pool_t *_pconf, ap_pool_t *plog, server_rec *s)
 static void dexter_pre_config(ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp)
 {
     static int restart_num = 0;
+    int no_detach = 0;
 
     one_process = !!getenv("ONE_PROCESS");
+    no_detach = !!getenv("NO_DETACH");
 
     /* sigh, want this only the second time around */
     if (restart_num++ == 1) {
        is_graceful = 0;
 
-       if (!one_process) {
+       if (!one_process && !no_detach) {
            ap_detach();
        }
 
index e7aad6d22455c7c39c5f92081f76d507bdb70f37..ba5514f209f399ca4f83ad0e94c9429a21b2a7ba 100644 (file)
@@ -841,14 +841,16 @@ int ap_mpm_run(ap_pool_t *_pconf, ap_pool_t *plog, server_rec *s)
 static void mpmt_beos_pre_config(ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptemp)
 {
     static int restart_num = 0;
+    int no_detach = 0;
 
     one_process = !!getenv("ONE_PROCESS");
+    no_detach = !!getenv("NO_DETACH");
 
     /* sigh, want this only the second time around */
     if (restart_num++ == 1) {
        is_graceful = 0;
 
-       if (!one_process) {
+       if (!one_process && !no_detach) {
            beosd_detach();
        }
 
index 3aec08e7c6174386a4c12fa7f1ef2e75c6ea2193..c9e7dc3deb8069973bfc9b1cfe1fc59360c3c4b2 100644 (file)
@@ -1176,14 +1176,16 @@ int ap_mpm_run(ap_pool_t *_pconf, ap_pool_t *plog, server_rec *s)
 static void mpmt_pthread_pre_config(ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptemp)
 {
     static int restart_num = 0;
+    int no_detach = 0;
 
     one_process = !!getenv("ONE_PROCESS");
+    no_detach = !!getenv("NO_DETACH");
 
     /* sigh, want this only the second time around */
     if (restart_num++ == 1) {
        is_graceful = 0;
 
-       if (!one_process) {
+       if (!one_process && !no_detach) {
            ap_detach();
        }
        ap_my_pid = getpid();
index e22cf248a71f3cbed0e78f0997ae8fc900329e23..16a7425ea01acf9d88a3a67b8ba0231d1e830f65 100644 (file)
@@ -1529,14 +1529,16 @@ int ap_mpm_run(ap_pool_t *_pconf, ap_pool_t *plog, server_rec *s)
 static void prefork_pre_config(ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp)
 {
     static int restart_num = 0;
+    int no_detach = 0;
 
     one_process = !!getenv("ONE_PROCESS");
+    no_detach = !!getenv("NO_DETACH");
 
     /* sigh, want this only the second time around */
     if (restart_num++ == 1) {
        is_graceful = 0;
 
-       if (!one_process) {
+       if (!one_process && !no_detach) {
            ap_detach();
        }