[launchd-dev] Diagnosing launchd daemon failure to launch

Iain Delaney iain.delaney at gmail.com
Fri Nov 7 05:37:15 PST 2008

Hi Dave,
	Thanks for the input, but if I want to use Mach services, couldn't I  
just use a named DO connection (like [NSConnection registerName:] )?  
Then I don't need to put anything about a Mach service in the plist. I  
tried this earlier and it seemed to work fine.

	Then I read tech note 2083: Daemons and Agents and found that DTS  
recommends against using Mach messages and suggests UNIX Domain  
sockets instead. That's how I ended up with my current problem. Are  
the Mach APIs and Distributed Objects really as dangerous as the tech  
note leads me to believe?

Thanks for your help,

Iain Delaney

On 6-Nov-08, at 5:14 PM, Dave Zarzycki wrote:

> Iain,
> Alternatively, given that your code uses Distributed Objects, one  
> can add a Mach service to the launchd property-list and then use  
> this on the server side:
> id serverBinding = [NSConnection serviceConnectionWithName:  
> @"com.example.exampleMachService" rootObject: exampleObject];
> And on the client side:
> id exampleRemoteObject = [NSConnection connectionWithRegisteredName:  
> @"com.example.exampleMachService" host: nil];
> Cheers,
> davez
> On Nov 6, 2008, at 10:37 AM, Iain Delaney wrote:
>> Ahh, that was the problem. So the real issue is that my daemon is  
>> loading, but not responding to my client app.
>> I'm trying to use Distributed Objects on top of UNIX Domain  
>> sockets. The directory for the socket is /var/tmp, and the client  
>> and server can communicate if I run both programs inside XCode.  
>> However, when I move the daemon program to /Library/ 
>> PrivilegedHelperTools and copy to plist into /Library/LaunchDaemons  
>> everything stops working. The client seems to be hanging while  
>> trying to connect to the socket.
>> Any ideas what I'm doing wrong?
>> Thanks,
>> Iain
>> At 10:46 -0500 5/11/08, Iain Delaney wrote:
>> >Then I reboot, and run 'launchctl list' in the terminal.
>> Did you use "sudo launchctl list", or just "launchctl list"?  The
>> latter will show you the list of jobs for login session launchd, not
>> for the global launchd.
>> S+E
>> -- 
>> Quinn "The Eskimo!"                    <http://www.apple.com/developer/ 
>> >
>> Apple Developer Relations, Developer Technical Support, Core OS/ 
>> Hardware
>> _______________________________________________
>> launchd-dev mailing list
>> launchd-dev at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/launchd-dev

More information about the launchd-dev mailing list