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] make -DNO_DETACH useful in more situations
Date Tue, 02 Apr 2002 15:54:28 GMT
+0.5

This is ok but I like -DFOREGROUND better. :) The reason I like it
is because I still want it to be a fatal error if setsid() failed
and they intended to run httpd under daemontools or the like.

-aaron


On Tue, Apr 02, 2002 at 10:28:22AM -0500, Jeff Trawick wrote:
> If running in the foreground then ignore errors from apr_proc_detach()
> (most likely setsid() failed because we're process group leader).
> This is a simpler alternative to adding -DFOREGROUND and associated
> apr_proc_detach() changes.
> 
> Index: server/mpm/prefork/prefork.c
> ===================================================================
> RCS file: /home/cvspublic/httpd-2.0/server/mpm/prefork/prefork.c,v
> retrieving revision 1.257
> diff -u -r1.257 prefork.c
> --- server/mpm/prefork/prefork.c	29 Mar 2002 14:33:50 -0000	1.257
> +++ server/mpm/prefork/prefork.c	2 Apr 2002 15:25:16 -0000
> @@ -1215,9 +1215,11 @@
>          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");
> -            return HTTP_INTERNAL_SERVER_ERROR;
> +            ap_log_error(APLOG_MARK, no_detach ? APLOG_WARNING : APLOG_CRIT, 
> +                         rv, NULL, "apr_proc_detach failed");
> +            if (!no_detach) { /* just a warning otherwise */
> +                return HTTP_INTERNAL_SERVER_ERROR;
> +            }
>          }
>      }

Mime
View raw message