Converting to launchd user agent
Converting to launchd user agent
- Subject: Converting to launchd user agent
- From: Steve Sisak <email@hidden>
- Date: Mon, 7 Jul 2008 11:38:45 -0400
I have a per-user service that is currently implemented as a global
login item (as it needs GUI access and must support back to Mac OS
10.2.8), but really wants to be implemented as a GUI launchd agent on
10.5 and newer, but should not load as a launchd agent on 10.4.x (as
it needs a graphic context and there are issues with this pre-10.5).
I'd also like to cleanly handle the case where a user updates their
OS from 10.4.x to 10.5.x w/o requiring a reinstallation if possible.
I think I understand the pieces (I already have a load-on-demand
daemon), but want to make sure I handle the edge cases properly so
that I can install the LaunchAgent file on previous releases, but
only load on 10.5 and newer.
Bonus points if I can make it load on demand, although I'm not sure
if I can do this cleanly as, for historical reasons, the mach port it
registers contains the security session id of the process it's
running in.
Given that per-session bootstrap namespaces only exist on 10.5, I
might be able to take advantage of that fact.
Based on TN2083, it looks like I want to set:
LimitLoadToSessionType = Aqua
Also, if I set
OnDemand = true
RunAtLoad = false
KeepAlive = false
and load on demand via a static port name per-session bootstrap
namespace, then I shouldn't load on 10.4 and would load on 10.5.
Is this correct?
Can anyone point me to an example of setting up the plist and code to
tickle the agent?
Thanks,
-Steve
_______________________________________________
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