Re: should setsid() create new bootstrap context?
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Damien Sorresso <dsorresso@apple.com> 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 (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Bill Janssen