[prev in list] [next in list] [prev in thread] [next in thread] 

List:       launchd-dev
Subject:    Re: [launchd-dev] Launchd API
From:       Rainer Brockerhoff <rainer () brockerhoff ! net>
Date:       2009-02-02 19:01:42
Message-ID: p06240806c5acef7e990d () [192 ! 168 ! 1 ! 100]
[Download RAW message or body]

At 07:00 -0800 02/02/09, launchd-dev-request@lists.macosforge.org wrote:
> Date: Mon, 2 Feb 2009 09:32:29 +0000
> From: Quinn <eskimo1@apple.com>
> Message-ID: <p06240803c5ac6d770052@[10.0.40.15]>
> 
> At 22:03 +0100 28/1/09, Xavier Gu?rin wrote:
> > Reading launchctl.c I've already been able to do
> > some of the polling code of the agent (even
> > though some data structure are still a complete
> > mystery as I speak), but the load/unload part
> > seems really intricate, and I'm afraid to be
> > obliged to use execve + launchctl to make it
> > work.
> 
> Right now the <launch.h> API is only rated for
> daemons checking in with launchd (ala SampleD).
> It is not really designed for job management.
> Rather, we recommend that folks do their job
> management by fork/exec of launchctl.

Despite your recommendation :-) I wrote, or rather, repurposed some code from the \
launchd project to get job status info using <launch.h>: \
http://www.brockerhoff.net/bb/viewtopic.php?p=2647#2647

Seems to work well, and if the details change out from under it, it will stop working \
gracefully.

I wouldn't do that for starting/stopping jobs though; too complex. I suppose I should \
file a bug to request to get some of the launchctl functionality in CoreFoundation... \
CFLaunchGetJobInfo, CFLaunchLoadJob, etc.

-- 
Rainer Brockerhoff  <rainer@brockerhoff.net>
Belo Horizonte, Brazil
"In the affairs of others even fools are wise
 In their own business even sages err."
Weblog: http://www.brockerhoff.net/bb/viewtopic.php
_______________________________________________
launchd-dev mailing list
launchd-dev@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/launchd-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic