Launchd, AbandonProcessGroup, system() vs fork/exec
Launchd, AbandonProcessGroup, system() vs fork/exec
- Subject: Launchd, AbandonProcessGroup, system() vs fork/exec
- From: Todd Heberlein <email@hidden>
- Date: Tue, 01 Nov 2011 15:45:29 -0700
Don't know if Darwin-dev is the right place for this question... if not, please point me in the right direction.
I have a UNIX program started by launchd when a file system is mounted. In this program I create a second process to carry out some additional task. In my .plist file I have AbandonProcessGroup set to <true/>.
Starting the second program this way works fine:
system(execution_path.c_str());
But starting the program this way does *not*:
child_pid = fork();
if (child_pid == 0) {
execl(execution_path.c_str(), execution_path.c_str());
...
}
Both approaches work when launching the program from the command line. Why does the AbandonProcessGroup not work in the second version?
Todd
_______________________________________________
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