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;
+            }
         }
     }

-- 
Jeff Trawick | [EMAIL PROTECTED]
Born in Roswell... married an alien...

Reply via email to