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

Mike Fischer mike_fischer at mac.com
Thu Apr 3 03:53:41 PDT 2008


Am 03.04.2008 um 08:30 schrieb Quinn <eskimo1 at apple.com>:
>
> 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.

:-) Would have helped on it's own though. I was just making sure I  
understood because some experiments I did with a custom Launch Agent  
to create a system profile report once per day (for having it handy  
when filing bug reports) seemed to make it necessary to logout/login  
to make it work. I tried unload/load (I think) without success but I  
didn't document my exact steps to get it to work. I'll just mark this  
off as experimenting with too many unknown variables and too little  
knowledge. The Launch Agent now works btw.


> 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".

Thanks for the very clear explanation.


Mike
-- 
Mike Fischer     Softwareentwicklung, EDV-Beratung
                                 Schulung, Vertrieb
Note:             I read this list in digest mode!
       Send me a private copy for faster responses.



More information about the launchd-dev mailing list