[launchd-dev] SUMMARY: Can a launchd job get any access to its invoking plist?

Norman Gray norman at astro.gla.ac.uk
Mon Dec 23 14:12:21 PST 2013


On 2013 Dec 4, at 17:03, Norman Gray <norman at astro.gla.ac.uk> wrote:

> Can a launchd job get any access to its invoking plist?

(I realise I should have followed this up with the list)

This appears to be broadly possible in fact, but the interface discussed (and described in Apple's SampleD sample code) is apparently documented nowhere other than in this sample code, and also possibly in Mac OS X Internals: A Systems Approach (Amit Singh, http://osxbook.com, thanks to Mitchell J Laurren-Ring for pointing this out).

Also, it is actually catering to, and specific to, the case where an application wants to check in to get access to a launchd-created socket, so (on further investigation) it doesn't actually work in the case I'm interested in.

Put together, I'm left with the feeling that, while the behaviour I want seems possible, and while I think it's neater in this case than passing more state in environment variables, the API to support such behaviour is, if not deprecated, than at least somewhat discouraged, and at any rate not idiomatic.

For completeness, I've created an enhancement request (15720781) for something like this to be supported, with a pointer back to the discussion here (who knows, I speculate this may even find its way back to you, Damien!).

Thanks to all for your suggestions.

All the best,

Norman


-- 
Norman Gray  :  http://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK



More information about the launchd-dev mailing list