On Jun 29, 2009, at 11:52 PM, Quinn wrote:
At 23:44 +0200 29/6/09, Iceberg-Dev wrote:
- Is there an example somewhere that _works_ and covers launching a daemon with launchd using sockets or mach port as dependencies?
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: - I don't want to ask the user a password every time. This is apparently cover by the sample code in one specific case. I need to look at this more deeply. - I may have 2 different processes talking to the privileged tool. - The sample doesn't seem secure with the helper tool being embedded in the application bundle. There is a potential root escalation privilege issue here. - I didn't see a LaunchDaemon plist file. Basically the issue I see (and have) is that if you want to launch a tool on every startup, it's a very simple plist to write (and right permissions to set). If you want to depend on socket or mach port, it's apparently a ton of code you have to write or understand. There is a huge gap between these 2 cases and the ladder is missing some steps.
- Is there a tutorial somewhere that covers this subject?
[...] Also, BAS has lots of comments and documentation. And DaveZ's Google TechTalk is definitely worth a viewing.
<http://video.google.com/videoplay?docid=1781045834610400422>
Looks like it covers the same topics as old WWDC sessions.