]> granicus.if.org Git - apache/commitdiff
Add -X functionality back to httpd.
authorJustin Erenkrantz <jerenkrantz@apache.org>
Thu, 30 Aug 2001 20:50:06 +0000 (20:50 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Thu, 30 Aug 2001 20:50:06 +0000 (20:50 +0000)
- Updates upgrading.html
- Reverts Aaron's earlier docco patch (sorry...)
- Adds -X to all mpms in the tree

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

14 files changed:
CHANGES
docs/manual/upgrading.html.en
docs/manual/upgrading.html.fr
include/http_main.h
server/main.c
server/mpm/beos/beos.c
server/mpm/experimental/perchild/perchild.c
server/mpm/mpmt_os2/mpmt_os2.c
server/mpm/perchild/perchild.c
server/mpm/prefork/prefork.c
server/mpm/spmt_os2/spmt_os2.c
server/mpm/threaded/threaded.c
server/mpm/winnt/mpm_winnt.c
server/mpm/worker/worker.c

diff --git a/CHANGES b/CHANGES
index 2a1022c2b9b9077ea0eb8b7ad052a3b075e068ac..94e156703949834ee6e428c8dfaa157b71d23f64 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 Changes with Apache 2.0.26-dev
 
+  *) Add -X functionality back.  This indicates to all MPMs and any other
+     part of Apache that it should run in "debug" mode.  [Justin Erenkrantz]
+
   *) Some initial support for the cygwin platform [prefork only].
      This is not to be confused with support for the WinNT/Win32
      platform, which is the recommended configuration for native
index 3a8c47c248696ab77bb006e23284f1561b4ee761..d06bea5c5b17c6280a843907c23848395f07d8f4 100644 (file)
@@ -108,12 +108,6 @@ parent process with <code>WINCH</code> rather than
 which was used for printing the virtual host configuration has
 been replaced by <code>-t -D DUMP_VHOSTS</code>.</li>
 
-<li>The <code>httpd</code> command line option <code>-X</code> has
-been removed.  Most MPMs allow the same functionality to be requested
-by using the <code>-D ONE_PROCESS</code> command line
-option.  In addition, a <code>-D NO_DETACH</code> command line
-option is available.</li>
-
 <li>The module mod_auth_digest, which was experimental in Apache 1.3
 is now a standard module.</li>
 
index aaf2b5baeecd177f1f2785864030833dc520aacf..b95661ba8599603fa41945b1d7296a14fba53c33 100644 (file)
@@ -105,11 +105,6 @@ signal <code>USR1</code>.</li>
 qui servait à afficher la configuration des hôtes virtuels est 
 remplacé par <code>-t -D DUMP_VHOSTS</code>.</li>
 
-<li>L'option <code>-X</code> du programme <code>httpd</code> 
-est supprime. La majorité des MPM permettent la même fonctionnalité
-en définissant les variables d'environnement  <code>ONE_PROCESS</code> et
-<code>NO_DETACH</code> avant de lancer <code>httpd</code>.</li>
-
 <li>Le module mod_auth_digest, qui était expérimental dans la version 1.3,
 est maintenant un module standard.</li>
 
index cd81404fda44d180ef97816ba2c62766c92bb9df..102265c9d2eb5c664e94df227c07a5117921d2f2 100644 (file)
@@ -63,7 +63,7 @@
  * in apr_getopt() format.  Use this for default'ing args that the MPM
  * can safely ignore and pass on from its rewrite_args() handler.
  */
-#define AP_SERVER_BASEARGS "C:c:D:d:f:vVlLth?"
+#define AP_SERVER_BASEARGS "C:c:D:d:f:vVlLth?X"
 
 #ifdef __cplusplus
 extern "C" {
index cfee4a987d9eab9facc7f4e9c6375777aa03a8f7..4b18845e141e42a8e01d489e9f156e42f5182f8a 100644 (file)
@@ -344,6 +344,10 @@ int main(int argc, const char * const argv[])
            new = (char **)apr_array_push(ap_server_config_defines);
            *new = apr_pstrdup(pcommands, optarg);
            break;
+       case 'X':
+           new = (char **)apr_array_push(ap_server_config_defines);
+           *new = "DEBUG";
+           break;
        case 'f':
            confname = optarg;
            break;
index 036604ed6bcd6195e83e6e75e567d35cc63aac99..e539c490e1e38e1a969b2dd9e079c38965a2e106 100644 (file)
@@ -944,10 +944,17 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
 static void beos_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
 {
     static int restart_num = 0;
-    int no_detach = 0;
+    int no_detach, debug;
 
-    one_process = !!ap_exists_config_define("ONE_PROCESS");
-    no_detach = !!ap_exists_config_define("NO_DETACH");
+    debug = ap_exists_config_define("DEBUG");
+
+    if (debug)
+        no_detach = one_process = 1;
+    else
+    {
+        one_process = ap_exists_config_define("ONE_PROCESS");
+        no_detach = ap_exists_config_define("NO_DETACH");
+    }
 
     /* sigh, want this only the second time around */
     if (restart_num++ == 1) {
index e5d43aeed6001aa79b578b4a6ff7af282ad969b7..2f781aed91b4146646b68e7febd0d1c03e7fbe4b 100644 (file)
@@ -170,12 +170,10 @@ static apr_lock_t *pipe_of_death_mutex;
 
 server_rec *ap_server_conf;
 
-/* The perchild MPM respects a couple of runtime flags that can aid
- * in debugging. Setting the -DNO_DETACH flag will prevent the root process
- * from detaching from its controlling terminal. Additionally, setting
- * the -DONE_PROCESS flag (which implies -DNO_DETACH) will get you the
- * child_main loop running in the process which originally started up.
- * This gives you a pretty nice debugging environment.  (You'll get a SIGHUP
+/* one_process --- debugging mode variable; can be set from the command line
+ * with the -X flag.  If set, this gets you the child_main loop running
+ * in the process which originally started up (no detach, no make_child),
+ * which is a pretty nice debugging environment.  (You'll get a SIGHUP
  * early in standalone_main; just continue through.  This is the server
  * trying to kill off any child processes which it might have lying
  * around --- Apache doesn't keep track of their pids, it just sends
@@ -1326,11 +1324,18 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
 static void perchild_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
 {
     static int restart_num = 0;
-    int no_detach = 0;
+    int no_detach, debug;
     int i;
 
-    one_process = !!ap_exists_config_define("ONE_PROCESS");
-    no_detach = !!ap_exists_config_define("NO_DETACH");
+    debug = ap_exists_config_define("DEBUG");
+
+    if (debug)
+        no_detach = one_process = 1;
+    else
+    {
+        one_process = ap_exists_config_define("ONE_PROCESS");
+        no_detach = ap_exists_config_define("NO_DETACH");
+    }
 
     /* sigh, want this only the second time around */
     if (restart_num++ == 1) {
index edfce5c6a618be96eda6d6b6cb1ebb00ba1d5766..405147629b7bfa97d1f8782f42298fbb8f04ca0e 100644 (file)
@@ -483,7 +483,8 @@ int ap_graceful_stop_signalled(void)
 
 static void mpmt_os2_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
 {
-    one_process = !!ap_exists_config_define("ONE_PROCESS");
+    one_process = ap_exists_config_define("ONE_PROCESS") || 
+                  ap_exists_config_define("DEBUG");
     is_graceful = 0;
     ap_listen_pre_config();
     ap_daemons_to_start = DEFAULT_START_DAEMON;
index e5d43aeed6001aa79b578b4a6ff7af282ad969b7..2f781aed91b4146646b68e7febd0d1c03e7fbe4b 100644 (file)
@@ -170,12 +170,10 @@ static apr_lock_t *pipe_of_death_mutex;
 
 server_rec *ap_server_conf;
 
-/* The perchild MPM respects a couple of runtime flags that can aid
- * in debugging. Setting the -DNO_DETACH flag will prevent the root process
- * from detaching from its controlling terminal. Additionally, setting
- * the -DONE_PROCESS flag (which implies -DNO_DETACH) will get you the
- * child_main loop running in the process which originally started up.
- * This gives you a pretty nice debugging environment.  (You'll get a SIGHUP
+/* one_process --- debugging mode variable; can be set from the command line
+ * with the -X flag.  If set, this gets you the child_main loop running
+ * in the process which originally started up (no detach, no make_child),
+ * which is a pretty nice debugging environment.  (You'll get a SIGHUP
  * early in standalone_main; just continue through.  This is the server
  * trying to kill off any child processes which it might have lying
  * around --- Apache doesn't keep track of their pids, it just sends
@@ -1326,11 +1324,18 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
 static void perchild_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
 {
     static int restart_num = 0;
-    int no_detach = 0;
+    int no_detach, debug;
     int i;
 
-    one_process = !!ap_exists_config_define("ONE_PROCESS");
-    no_detach = !!ap_exists_config_define("NO_DETACH");
+    debug = ap_exists_config_define("DEBUG");
+
+    if (debug)
+        no_detach = one_process = 1;
+    else
+    {
+        one_process = ap_exists_config_define("ONE_PROCESS");
+        no_detach = ap_exists_config_define("NO_DETACH");
+    }
 
     /* sigh, want this only the second time around */
     if (restart_num++ == 1) {
index 320c8b9757bc457f8193d68551c931fd4eeb1b1b..c10c51a1fc2319d15cf5ffb12450db29c59e52cd 100644 (file)
@@ -156,12 +156,10 @@ static apr_socket_t *sd;
 static fd_set listenfds;
 static int listenmaxfd;
 
-/* The prefork MPM respects a couple of runtime flags that can aid
- * in debugging. Setting the -DNO_DETACH flag will prevent the root process
- * from detaching from its controlling terminal. Additionally, setting
- * the -DONE_PROCESS flag (which implies -DNO_DETACH) will get you the
- * child_main loop running in the process which originally started up.
- * This gives you a pretty nice debugging environment.  (You'll get a SIGHUP
+/* one_process --- debugging mode variable; can be set from the command line
+ * with the -X flag.  If set, this gets you the child_main loop running
+ * in the process which originally started up (no detach, no make_child),
+ * which is a pretty nice debugging environment.  (You'll get a SIGHUP
  * early in standalone_main; just continue through.  This is the server
  * trying to kill off any child processes which it might have lying
  * around --- Apache doesn't keep track of their pids, it just sends
@@ -1319,10 +1317,17 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
 static void prefork_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
 {
     static int restart_num = 0;
-    int no_detach = 0;
+    int no_detach, debug;
 
-    no_detach = !!ap_exists_config_define("NO_DETACH");
-    one_process = !!ap_exists_config_define("ONE_PROCESS");
+    debug = ap_exists_config_define("DEBUG");
+
+    if (debug)
+        no_detach = one_process = 1;
+    else
+    {
+        no_detach = ap_exists_config_define("NO_DETACH");
+        one_process = ap_exists_config_define("ONE_PROCESS");
+    }
 
     /* sigh, want this only the second time around */
     if (restart_num++ == 1) {
index 2d3e7107ff4229a9dec3e256dac2dd74c20894a5..9f87729a1730246438c86b4b24c13b2e2e9d9186 100644 (file)
@@ -104,10 +104,10 @@ char ap_coredump_dir[MAX_STRING_LEN];
 
 server_rec *ap_server_conf;
 
-/* The spmt_os2 MPM respects a runtime flag that can aid
- * in debugging. Setting the -DONE_PROCESS flag will get you the
- * child_main loop running in the process which originally started up.
- * This gives you a pretty nice debugging environment.  (You'll get a SIGHUP
+/* one_process --- debugging mode variable; can be set from the command line
+ * with the -X flag.  If set, this gets you the child_main loop running
+ * in the process which originally started up (no detach, no make_child),
+ * which is a pretty nice debugging environment.  (You'll get a SIGHUP
  * early in standalone_main; just continue through.  This is the server
  * trying to kill off any child processes which it might have lying
  * around --- Apache doesn't keep track of their pids, it just sends
@@ -1151,7 +1151,8 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
 
 static void spmt_os2_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
 {
-    one_process = !!ap_exists_config_define("ONE_PROCESS");
+    one_process = ap_exists_config_define("ONE_PROCESS") ||
+                  ap_exists_config_define("DEBUG");
 
     is_graceful = 0;
     ap_listen_pre_config();
index 2040af7a42d3bb74086c30d1ecca9ad81692bbff..b55923f111c4a394126c76de241af96a21ec3168 100644 (file)
@@ -148,13 +148,10 @@ static apr_lock_t *pipe_of_death_mutex;   /* insures that a child process only
 
 server_rec *ap_server_conf;
 
-
-/* The threaded MPM respects a couple of runtime flags that can aid
- * in debugging. Setting the -DNO_DETACH flag will prevent the root process
- * from detaching from its controlling terminal. Additionally, setting
- * the -DONE_PROCESS flag (which implies -DNO_DETACH) will get you the
- * child_main loop running in the process which originally started up.
- * This gives you a pretty nice debugging environment.  (You'll get a SIGHUP
+/* one_process --- debugging mode variable; can be set from the command line
+ * with the -X flag.  If set, this gets you the child_main loop running
+ * in the process which originally started up (no detach, no make_child),
+ * which is a pretty nice debugging environment.  (You'll get a SIGHUP
  * early in standalone_main; just continue through.  This is the server
  * trying to kill off any child processes which it might have lying
  * around --- Apache doesn't keep track of their pids, it just sends
@@ -1360,10 +1357,17 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
 static void threaded_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
 {
     static int restart_num = 0;
-    int no_detach = 0;
+    int no_detach, debug;
+
+    debug = ap_exists_config_define("DEBUG");
 
-    one_process = !!ap_exists_config_define("ONE_PROCESS");
-    no_detach = !!ap_exists_config_define("NO_DETACH");
+    if (debug)
+        no_detach = one_process = 1;
+    else
+    {
+        no_detach = ap_exists_config_define("NO_DETACH");
+        one_process = ap_exists_config_define("ONE_PROCESS");
+    }
 
     /* sigh, want this only the second time around */
     if (restart_num++ == 1) {
index 45712d51aea438250a73fdc0592ab69119bd47fb..c8a4c97c193a7a8cc2764c03aab15fe014fd6b90 100644 (file)
@@ -1835,7 +1835,8 @@ static void winnt_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *pt
      */
     apr_status_t rv;
 
-    if (ap_exists_config_define("ONE_PROCESS"))
+    if (ap_exists_config_define("ONE_PROCESS") ||
+        ap_exists_config_define("DEBUG"))
         one_process = -1;
 
     if (!strcasecmp(signal_arg, "runservice")
index 3634b16259c3ead09e4339381217f53183ed48f6..2fab078e340b11b51aef194ee43ed6184595e1ee 100644 (file)
@@ -1438,10 +1438,17 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
 static void worker_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
 {
     static int restart_num = 0;
-    int no_detach = 0;
+    int no_detach, debug;
 
-    one_process = !!ap_exists_config_define("ONE_PROCESS");
-    no_detach = !!ap_exists_config_define("NO_DETACH");
+    debug = ap_exists_config_define("DEBUG");
+
+    if (debug)
+        no_detach = one_process = 1;
+    else
+    {
+        one_process = ap_exists_config_define("ONE_PROCESS");
+        no_detach = ap_exists_config_define("NO_DETACH");
+    }
 
     /* sigh, want this only the second time around */
     if (restart_num++ == 1) {