On Aug 17, 2009 9:21pm, Wim Lewis <email@hidden> wrote: > On Aug 17, 2009, at 8:40 AM, Simon Strandgaard wrote: > [snip] > > As far as I know it isn't possible to reparent a process. It might be possible to put your launchd-launched process in the same process group as your application using setpgid() --- I don't know. >
I have tried setpgid() as root, but it refuses to change group id for the process. I can't remember my conclusion to why it didn't work. I think it was that reparenting is only possible upwards in the process hierarchy. Downward is not possible, which I hope that I am wrong about.
[snip] > IIRC, it's possible to ask launchd to kill one of its jobs, which might be another approach.
I have 3 different programs. A worker program. A launchd program. A GUI program. I spawn between 2 and 4 worker processes via my launchd program by invoking posix_spawn(). When the workers have been started, the launchd program goes back to sleep. The spawn takes less than 100 msec, so its not a long running job.
All this is for a file manager, so when there is a filesystem timeout the affected process can be killed. Root is needed so I can browse around in the /var folder and go through all the mounted /Volumes.
I originally thought about having just a single launchd process, but I ran into some problems with the BAS code combined with distributed objects and throttling. I can't remember why I made that decision.
I just want to make sure I don't open a big security hole.
> > There's probably a better list for this question, since it doesn't actually involve CDSA or crypto. :) [snip]
Would the darwin-dev list be ok?
-- Simon Strandgaard http://graphicdesignertoolbox.com/
Do not post admin requests to the list. They will be ignored.
Apple-cdsa mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden