Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 57965 invoked by uid 500); 1 Apr 2002 22:26:38 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 57951 invoked from network); 1 Apr 2002 22:26:38 -0000 X-Authentication-Warning: rdu88-250-035.nc.rr.com: trawick set sender to trawick@attglobal.net using -f Sender: trawick@rdu88-250-035.nc.rr.com To: dev@httpd.apache.org Subject: Re: [PATCH] -DNO_DETACH and/or apr_proc_detach() confusion? References: <200204012153.g31LrTp02672@smtp-server.nc.rr.com> <20020401141018.S1154@clove.org> From: Jeff Trawick Date: 01 Apr 2002 17:23:07 -0500 In-Reply-To: <20020401141018.S1154@clove.org> Message-ID: Lines: 43 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Aaron Bannert writes: > On Mon, Apr 01, 2002 at 04:53:29PM -0500, Jeff Trawick wrote: > > This gets -DNO_DETACH working for me with Apache's prefork MPM on > > Linux and FreeBSD. But from Aaron's commit log for revision > > 1.34 I gather that this will break daemontools-like programs. > > > > How should I get "./httpd -DNO_DETACH" to work? Calling setsid() is > > bogus. > > > > This patch avoids the setsid() logic if we don't daemonize. > > I don't understand how this is broken. If you don't want to daemonize > but you still want to detach, you must be sure that httpd will not be > a process group leader when it is started. This can be done by running > httpd from a shell script or as a child of another process (like from > daemontools). Running "./httpd -DNO_DETACH" from the command line > will cause httpd to be a process group leader [in most modern shells], > which causes setsid() to fail and httpd to spit out an error. This seems > correct to me. What am I missing? Perhaps apr_proc_detach needs to > fail with a more specific error, and httpd should detect that error > and write a more appropriate message? as far as error reporting: the error is written to the log, not to stderr, so you don't see it as far as what I want to do: I just want to run httpd in the foreground (e.g., from gdb); should I be doing something other than gdb prefix/bin/httpd break foo r -DNO_DETACH ? Thanks, -- Jeff Trawick | trawick@attglobal.net Born in Roswell... married an alien...