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

Quinn eskimo1 at apple.com
Tue Jun 30 02:37:03 PDT 2009


At 1:06 +0200 30/6/09, Iceberg-Dev wrote:
>>BetterAuthorizationSample is your friend.
>>
>><http://developer.apple.com/samplecode/BetterAuthorizationSample/index.html>
>
>Not sure. Looked at it and it probably won't work in my case as:

Ah, you misunderstand me.  Sorry for not being clearer.

The overall goal of BAS is to demonstrate how to do the 'self 
install' thing, and you're not interested in the that, so it's 
obviously not a good match for your particular product.  However, if 
you run the sample and then look at the final state of the system, 
you'll see how a launch-on-demand launchd daemon is meant to be set 
up.  That is, you can look at the property list it installs, the 
helper tool it installs, and the source to that helper tool, and 
thence see how you should set up your daemon.

Specifically, run the sample and look at the following:

o The plist file installed in "/Library/LaunchDaemons/<bundleID>.plist".

o The helper tool installed in "/Library/PrivilegedHelperTools/<bundleID>".

o The code used by the helper tool to check in with launchd. 
Specifically, the CheckInWithLaunchd routine in 
"BetterAuthorizationSampleLib.c".

<http://developer.apple.com/samplecode/BetterAuthorizationSample/listing1.html>

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