[launchd-dev] Understanding bootstrap idea in different versions of MacOS

eveningnick eveningnick eveningnick at gmail.com
Mon Jan 24 10:35:38 PST 2011


Hello
I understand that this is not an apple way to respond about obsolete
versions of their software.
But i am hoping some of launchd developers look through this list, and
who are aware of pecularities of their child :)

i am trying to launch an agent programmatically (not only
automatically when the system is started), but in a certain moment.
I mean, a user installs an application, and he is happy having an
agent run as soon as an app is installed.

as i've been told on this list some time ago, it can be done only by
exec'ing "launchctl -w load [plist file path]", as long as OS X does
not provide any explicit ways to communicate to per user launchd
service and ask it to process a plist file. I assume that launchd
"interface" could be retrieved by reading sources of launchctl (i've
heard they are available), but my qualification doesnt allow me to do
that so far.

The problem i've run into was launchctl and launchd acting differently
on different versions of OS X, partly because launchctl changed the
way it searches for the right launchd instance (so i've been told on
this list) from the per-bootstrap to per-user,
In archives i found some  ways of "talking" to the right instance of
launchd - like, specifying "-S" parameter, or using "bslist" param.
They seem to work differently not only on OS X 10.5 and 10.6, but even
inside 10.5 builds (for example, while on 10.5.6 sudo launchctl load
-w myagent.plist launches an agent, on 10.5.4 users get "Socket not
connected").

Could you please explain, how to 'talk' to the right launchd and what
is the difference in the way of 'talking' in different versions of OS
X?
Thanx


More information about the launchd-dev mailing list