httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Bannert <aa...@clove.org>
Subject Re: [PATCH] Add -X back in...
Date Thu, 30 Aug 2001 08:10:01 GMT
On Wed, Aug 29, 2001 at 10:06:20PM -0700, Justin Erenkrantz wrote:
> Assuming no one vetoes this, this can get committed before we tag
> tomorrow.  No rush though.  =-)  
> 
> - Updates upgrading.html
> - Reverts Aaron's earlier docco patch (sorry...)

No reason to be sorry, as long as we end up with something correct.


> - Adds -X to all mpms in the tree
> 
> I won't be around tomorrow morning to commit this before 2.0.26 is
> tagged.  If it doesn't make it into 2.0.26 and no one has vetoed it, 
> then I'll commit it on Friday.  -- justin

I have some comments below:


> 
> Index: docs/manual/upgrading.html.en
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/docs/manual/upgrading.html.en,v
> retrieving revision 1.12
> diff -u -r1.12 upgrading.html.en
> --- docs/manual/upgrading.html.en	2001/08/27 14:23:30	1.12
> +++ docs/manual/upgrading.html.en	2001/08/30 04:58:42
> @@ -108,12 +108,6 @@
>  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: docs/manual/upgrading.html.fr
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/docs/manual/upgrading.html.fr,v
> retrieving revision 1.2
> diff -u -r1.2 upgrading.html.fr
> --- docs/manual/upgrading.html.fr	2001/02/28 10:57:26	1.2
> +++ docs/manual/upgrading.html.fr	2001/08/30 04:58:42
> @@ -105,11 +105,6 @@
>  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: include/http_main.h
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/include/http_main.h,v
> retrieving revision 1.19
> diff -u -r1.19 http_main.h
> --- include/http_main.h	2001/02/16 04:26:31	1.19
> +++ include/http_main.h	2001/08/30 04:58:42
> @@ -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: server/main.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/main.c,v
> retrieving revision 1.99
> diff -u -r1.99 main.c
> --- server/main.c	2001/05/22 01:31:11	1.99
> +++ server/main.c	2001/08/30 04:58:43
> @@ -344,6 +344,10 @@
>  	    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: server/mpm/beos/beos.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/mpm/beos/beos.c,v
> retrieving revision 1.60
> diff -u -r1.60 beos.c
> --- server/mpm/beos/beos.c	2001/08/15 21:11:58	1.60
> +++ server/mpm/beos/beos.c	2001/08/30 04:58:43
> @@ -944,10 +944,17 @@
>  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: server/mpm/mpmt_os2/mpmt_os2.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/mpm/mpmt_os2/mpmt_os2.c,v
> retrieving revision 1.5
> diff -u -r1.5 mpmt_os2.c
> --- server/mpm/mpmt_os2/mpmt_os2.c	2001/08/20 19:47:52	1.5
> +++ server/mpm/mpmt_os2/mpmt_os2.c	2001/08/30 04:58:43
> @@ -483,7 +483,8 @@
>  
>  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: server/mpm/perchild/perchild.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/perchild.c,v
> retrieving revision 1.76
> diff -u -r1.76 perchild.c
> --- server/mpm/perchild/perchild.c	2001/08/30 00:55:50	1.76
> +++ server/mpm/perchild/perchild.c	2001/08/30 04:58:43
> @@ -170,12 +170,10 @@
>  
>  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

Um...ONE_PROCESS and NO_DETACH are not going away, so don't remove that
comment. How about just add something about -X/-DDEBUG providing the same as
ONE_PROCESS and NO_DETACH. This may seem a minute point, but you have to
put yourself in the shoes of someone who is unfamiliar with the code.
Newbies will now read the comment and will not be able to figure out
why -X does what the comment says it does. At least for NO_DETACH I could
just search for that string and I'd find where the logic is.


> @@ -1326,11 +1324,18 @@
>  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: server/mpm/prefork/prefork.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/mpm/prefork/prefork.c,v
> retrieving revision 1.199
> diff -u -r1.199 prefork.c
> --- server/mpm/prefork/prefork.c	2001/08/30 00:55:50	1.199
> +++ server/mpm/prefork/prefork.c	2001/08/30 04:58:43
> @@ -156,12 +156,10 @@
>  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 @@
>  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: server/mpm/spmt_os2/spmt_os2.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/mpm/spmt_os2/spmt_os2.c,v
> retrieving revision 1.102
> diff -u -r1.102 spmt_os2.c
> --- server/mpm/spmt_os2/spmt_os2.c	2001/08/30 00:55:50	1.102
> +++ server/mpm/spmt_os2/spmt_os2.c	2001/08/30 04:58:44
> @@ -104,10 +104,10 @@
>  
>  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

Since this MPM doesn't have NO_DETACH, how about this instead:

@@ -104,10 +104,10 @@
 
 server_rec *ap_server_conf;
 
/* The spmt_os2 MPM respects a runtime flag that can aid
 * in debugging. Setting -DONE_PROCESS, -DDEBUG or -X 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
 * 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 @@
>  
>  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: server/mpm/threaded/threaded.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/mpm/threaded/threaded.c,v
> retrieving revision 1.62
> diff -u -r1.62 threaded.c
> --- server/mpm/threaded/threaded.c	2001/08/30 00:55:51	1.62
> +++ server/mpm/threaded/threaded.c	2001/08/30 04:58:44
> @@ -148,13 +148,10 @@
>  
>  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 @@
>  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: server/mpm/winnt/mpm_winnt.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/mpm_winnt.c,v
> retrieving revision 1.177
> diff -u -r1.177 mpm_winnt.c
> --- server/mpm/winnt/mpm_winnt.c	2001/08/23 19:29:45	1.177
> +++ server/mpm/winnt/mpm_winnt.c	2001/08/30 04:58:44
> @@ -1835,7 +1835,8 @@
>       */
>      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: server/mpm/worker/worker.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/mpm/worker/worker.c,v
> retrieving revision 1.20
> diff -u -r1.20 worker.c
> --- server/mpm/worker/worker.c	2001/08/30 01:00:50	1.20
> +++ server/mpm/worker/worker.c	2001/08/30 04:58:44
> @@ -1438,10 +1438,17 @@
>  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) {

Mime
View raw message