[launchd-dev] How to on demand launch for configurable port number?

Quinn eskimo1 at apple.com
Wed Apr 2 02:44:28 PDT 2008


At 10:20 +0100 2/4/08, Quinn wrote:
>At 17:05 +0200 1/4/08, Mike Fischer wrote:
>>So "unload" makes launchd completely forget about a service while 
>>"load" does the reverse?
>
>Right.

OK, that's was a little more succinct that I originally intended. 
Here's some more background:

This one super-confusing part of launchd if you're coming to it from 
scratch.  The lifecycle of a job is:

load -> start -> stop -> [...] -> unload

The load can be done implicitly (typically at the start of a session, 
for example, at startup time launchd loads all of the enabled jobs in 
/System/Library/LaunchDaemons) or explicitly (via "launchctl load"). 
Unloads, per se, only happen explicitly (via "launchctl unload"), but 
jobs are effectively unloaded if the session that they're loaded into 
dies (keep in mind that launchd's global session never dies).

Similarly, the start can be done implicitly (via the RunAtLoad 
property, or by meeting one of your the launch-on-demand criteria, or 
by the KeepAlive property) or explicitly (via "launchctl start"). 
And a stop happens when the job quits or, explicitly, via "launchctl 
stop".

S+E
-- 
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware


More information about the launchd-dev mailing list