On Mon, Jan 07, 2002 at 10:54:48PM -0800, Justin Erenkrantz wrote: > On Mon, Jan 07, 2002 at 10:53:00PM -0800, Jos Backus wrote: > > this may not be desired behavior. So maybe we should factor out the > > setpgid()/setsid() part into its own function (apr_proc_newsessid()?) and call > > it instead of apr_proc_detach() when using NO_DETACH? (apr_proc_detach() > > would also call this new function.) > > Precisely my thoughts. IMHO, split it out. (The name is a bit > iffy, but we can work on that...) -- justin
I think we should take the fork() stuff out of apr_proc_detach() instead. Detach is doing what it's supposed to, creating a new session (and therefore detaching from the controlling terminal). The only way it can reliably do that is if it is not a pgrp leader. IMO the way to handle this is to let apr_proc_deatch() assume it is already a non pgrp leader and put the fork() calls that ensure this outside. Another option is to have apr_proc_deatch() simply check if it is the pgrp leader, and if so to only then call the fork. -aaron
