Re: should setsid() create new bootstrap context?
Re: should setsid() create new bootstrap context?
- Subject: Re: should setsid() create new bootstrap context?
- From: Bill Janssen <email@hidden>
- Date: Fri, 3 Apr 2009 12:42:37 PDT
- Comments: In-reply-to Damien Sorresso <email@hidden> message dated "Fri, 03 Apr 2009 11:40:26 -0700."
Damien Sorresso <email@hidden> wrote:
> On Apr 3, 2009, at 11:32 AM, Bill Janssen wrote:
> > I think the root of my recent trouble with Darwin daemons is that I
> > expected a call to setsid() to create a new bootstrap context.
> > However,
> > it doesn't seem to do that. Is that a bug in Darwin?
>
> Why would you expect this?
Well, perhaps I'm just confused about the mapping of POSIX "session"
onto Darwin. I thought the whole point of setsid() is to create a new
process group that was independent of the pre-setsid process group. I'd
expect it to create a new bootstrap context that would also be
independent of the bootstrap context existing before setsid() was
called, so that that the process group in that parent session could be
terminated without affecting processes in the child session.
As it is, when I call
fork() ==> process B
setsid() ==> process group B
fork() ==> process C
exec()
as a non-root user from a bootstrap context which is then terminated
(say, an SSH login), I wind up with process C having a bad bootstrap
context. There are two possible reasons for this that I can see:
1. setsid() doesn't create a new bootstrap context for process group B,
or
2. setsid() does create a new BC, but process B is the group leader,
and the termination of B destroys the new context, so C winds up
with an invalid BC.
I'd appreciate more insight into this...
Bill
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden