[launchd-dev] Confused about sockets - please help!

Quinn eskimo1 at apple.com
Wed Mar 3 08:05:33 PST 2010


At 15:42 +0000 3/3/10, dreamcat four wrote:
>[...] does launchd still let the deamon developer to see this key 
>name in the returned results?

Yes.

>In which case, (and maybe wrongly but nevertheless), they might end 
>up writing some code that is sensitive to this key name?

Actually, there are circumstances where it's the right thing to do. 
Consider a daemon that has two listening sockets, one TCP socket for 
remote requests and one UNIX domain socket for local requests.  The 
daemon might want to treat these sockets differently, for security 
purposes perhaps, and the best way to distinguish them is via this 
key.

I'd recommend you treat this as follows:

o If you read an existing launchd property list, preserve these keys 
unless your client specifically changes one.

o If your client creates a new entry in Sockets, and doesn't 
explicitly specify a key, a reasonable default, like "Listeners", is 
fine.

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