[launchd-dev] Help with launchd sockets chicken and egg problem

Quinn "The Eskimo!" eskimo1 at apple.com
Tue Nov 2 04:26:38 PDT 2010


On 1 Nov 2010, at 23:24, Dave MacLachlan wrote:

> I understand that if I reboot the system that I can get the socket path via an environment variable, but how do I get it without rebooting?

Yeah, this is a bit of a bear.  launchd has a serious conceptual gap when it comes to the install, upgrade, and uninstall process.  We're tracking this as <rdar://problem/5476420>.

By far the best solution from a technical perspective is to force a restart of the system.  Obviously this is less than ideal from a UE perspective.

As to workarounds, I haven't ever investigated this properly, but I think the easiest would be for your master process to just quit and have launchd relaunch it, at which point it will profit the environment variable you specified via SecureSocketWithKey.

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