Re: launchd bug?: System: job_mig_spawn() can't find its session!
Re: launchd bug?: System: job_mig_spawn() can't find its session!
- Subject: Re: launchd bug?: System: job_mig_spawn() can't find its session!
- From: Damien Sorresso <email@hidden>
- Date: Sat, 31 Oct 2009 14:13:28 -0700
On Oct 31, 2009, at 9:02 AM, lbland wrote:
> hi guys!-
>
> I get this in my console:
>
> Oct 31 11:54:31 h003 com.apple.launchd[1]: System: Bug: launchd_core_logic.c:8686 (23932):0
> Oct 31 11:54:31 h003 com.apple.launchd[1]: System: job_mig_spawn() can't find its session!
> Oct 31 11:54:31 h003 my_process[225]: spawn_via_launchd() failed, errno=5 label=[0x0-0x75f75f].com.company.another path=a_path flags=1
>
> when using the launchd services API in a program.
You're talking about LaunchServices, I believe. Those APIs are not safe to call from a daemon. You should put this code in a launchd agent instead.
> It only seems to happen when I logout and then login to a different account. It did not seem to happen under Mac OS X 10.6.0, but is happening under 10.6.1.
>
> Maybe 10.6.2 will fix it??
>
> Google seems to indicate that it is not too uncommon (not unique) of a problem.
This is correct behavior.
> I know I've been a bit vague here, but feel free to reply with vague hints on what is wrong :-)
Daemons cannot manipulate the GUI, which is what the LaunchServices APIs do (by launching an application). Application launching only makes sense in the context of a user session, but you're calling into the API from the system context.
Think of it this way. When you're writing a daemon, you must assume that the machine is headless (no user logged in).
If you have access to the WWDC session videos, this topic was covered in greater detail in the "Designing for launchd" session.
--
Damien Sorresso
BSD Engineering
Apple Inc.
_______________________________________________
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