[launchd-dev] launchd: how is it supposed to be done?

Damien Sorresso dsorresso at apple.com
Mon Jun 29 15:47:00 PDT 2009


On Jun 29, 2009, at 3:31 PM, Iceberg-Dev wrote:
> I guess the #1 problem is that the Example section (ofd launchd.plist 
> (5)) lacks examples. I understand that you can't put a lot of  
> examples but right now (I'm looking on 10.4.10 so forgive me if it's  
> not totally up to date), there is only one simple example.

The examples you're seeking are a little more involved. The plist keys  
are the easy part. It's the code in the client and server (especially  
with Mach) that gets tricky and is poorly-documented.

> #6908216
>
> SampleD
>
> Didn't try fixing it since I'm in learning mode and would probably  
> do more damages than anything else.

There's no explanation of *what* is failing in the project build. What  
error did you get? Is a compiler error? Linker error? Missing SDK?  
Don't assume that we'll be able to reproduce your failure; everyone  
has different systems. You should add this information to your bug  
report.

Please see

http://developer.apple.com/BugReporter/bugbestpractices.html

for bug reporting guidelines.

For what it's worth, SampleD builds without issue on 10.6 under the  
10.5 SDK. It was originally written for the 10.4 SDK, so the fact that  
you're having problems is odd.

>>> - Looked for sample code using google. Was not able to find a  
>>> single good example. There are plenty of examples showing how to  
>>> write equivalents of crontab, StartupItems but none for triggering  
>>> a daemon with sockets or a mach port. Some of them apparently try  
>>> to deal with file dependencies it is not clear if they are even  
>>> sure with this.
>>
>> The lack of good Mach examples sucks, and I'm sorry that the  
>> situation is the way it is. But that's really all I can say about it.
>>
>>> By the way:
>>> -----------
>>>
>>> I attended the session on launchd at WWDC and was still like  
>>> Alicia Silverstone in that 1995 movie after that. I must be an  
>>> idiot.
>>
>> There was a rather extensive Q&A session after that talk, and I  
>> made myself available for questions even after that. Did I talk to  
>> you at all?
>
> The topic about socket and mach port was not really covered in the  
> session. So it didn't look to be a good topic for Q&A.

Sockets and Mach ports are principally how launchd's on-demand  
functionality was implemented. If that wasn't communicated adequately  
by the session, I'm sorry. But it would've been a completely  
appropriate question to ask.
-- 
Damien Sorresso
BSD Engineering
Apple Inc.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2425 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/launchd-dev/attachments/20090629/46a352bb/attachment-0001.bin>


More information about the launchd-dev mailing list