httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aa...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/worker worker.c
Date Thu, 21 Feb 2002 18:52:28 GMT
aaron       02/02/21 10:52:28

  Modified:    server/mpm/beos beos.c
               server/mpm/perchild perchild.c
               server/mpm/prefork prefork.c
               server/mpm/worker worker.c
  Log:
  Implement apr_proc_detach changes and allow -DNO_DETACH in the multi-process
  mode to not "daemonize" while detaching from the controlling terminal.
  This is necessary for Apache to work with process-management tools like
  AIX's "System Resource Controller" as well as Dan Bernstein's "daemontools".
  
  What this means is apache must _NOT_ be a process group leader if called
  with the -DNO_DETACH flag.
  
  Submitted from:     Jos Backus <josb@cncdsl.com>
  Edited/Reviewed by: Aaron Bannert
  
  Revision  Changes    Path
  1.85      +3 -2      httpd-2.0/server/mpm/beos/beos.c
  
  Index: beos.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/beos/beos.c,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -r1.84 -r1.85
  --- beos.c	15 Feb 2002 20:48:18 -0000	1.84
  +++ beos.c	21 Feb 2002 18:52:28 -0000	1.85
  @@ -1010,8 +1010,9 @@
       if (restart_num++ == 1) {
           is_graceful = 0;
           
  -        if (!one_process && !no_detach) {
  -	        rv = apr_proc_detach();
  +        if (!one_process) {
  +            rv = apr_proc_detach(no_detach ? APR_PROC_DETACH_FOREGROUND
  +                                           : APR_PROC_DETACH_DAEMONIZE);
               if (rv != APR_SUCCESS) {
                   ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
                                "apr_proc_detach failed");
  
  
  
  1.110     +3 -2      httpd-2.0/server/mpm/perchild/perchild.c
  
  Index: perchild.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/perchild.c,v
  retrieving revision 1.109
  retrieving revision 1.110
  diff -u -r1.109 -r1.110
  --- perchild.c	15 Feb 2002 20:48:19 -0000	1.109
  +++ perchild.c	21 Feb 2002 18:52:28 -0000	1.110
  @@ -1473,8 +1473,9 @@
       if (restart_num++ == 1) {
           is_graceful = 0;
   
  -        if (!one_process && !no_detach) {
  -            rv = apr_proc_detach();
  +        if (!one_process) {
  +            rv = apr_proc_detach(no_detach ? APR_PROC_DETACH_FOREGROUND
  +                                           : APR_PROC_DETACH_DAEMONIZE);
               if (rv != APR_SUCCESS) {
                   ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
                                "apr_proc_detach failed");
  
  
  
  1.246     +3 -2      httpd-2.0/server/mpm/prefork/prefork.c
  
  Index: prefork.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/prefork/prefork.c,v
  retrieving revision 1.245
  retrieving revision 1.246
  diff -u -r1.245 -r1.246
  --- prefork.c	17 Feb 2002 02:44:14 -0000	1.245
  +++ prefork.c	21 Feb 2002 18:52:28 -0000	1.246
  @@ -1216,8 +1216,9 @@
       if (restart_num++ == 1) {
   	is_graceful = 0;
   
  -    if (!one_process && !no_detach) {
  -        rv = apr_proc_detach();
  +    if (!one_process) {
  +        rv = apr_proc_detach(no_detach ? APR_PROC_DETACH_FOREGROUND
  +                                       : APR_PROC_DETACH_DAEMONIZE);
           if (rv != APR_SUCCESS) {
               ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
                            "apr_proc_detach failed");
  
  
  
  1.80      +7 -6      httpd-2.0/server/mpm/worker/worker.c
  
  Index: worker.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/worker/worker.c,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- worker.c	21 Feb 2002 14:22:05 -0000	1.79
  +++ worker.c	21 Feb 2002 18:52:28 -0000	1.80
  @@ -1551,17 +1551,17 @@
               }
           }
           else if (!max_clients
  -                && strncasecmp(pdir->directive, "MaxClients", 10) == 0) {
  +                 && strncasecmp(pdir->directive, "MaxClients", 10) == 0) {
               max_clients = pdir;
           }
       }
   
       debug = ap_exists_config_define("DEBUG");
   
  -    if (debug)
  +    if (debug) {
           no_detach = one_process = 1;
  -    else
  -    {
  +    }
  +    else {
           one_process = ap_exists_config_define("ONE_PROCESS");
           no_detach = ap_exists_config_define("NO_DETACH");
       }
  @@ -1570,8 +1570,9 @@
       if (restart_num++ == 1) {
           is_graceful = 0;
   
  -        if (!one_process && !no_detach) {
  -            rv = apr_proc_detach();
  +        if (!one_process) {
  +            rv = apr_proc_detach(no_detach ? APR_PROC_DETACH_FOREGROUND
  +                                           : APR_PROC_DETACH_DAEMONIZE);
               if (rv != APR_SUCCESS) {
                   ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
                                "apr_proc_detach failed");
  
  
  

Mime
View raw message