Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

launchd and binding

Is there a way to have launchd bind a startup process to a particular interface or IP address? I'm looking for the equivelant of "bind=x.x.x.x" in xinetd

thanks

MacPro, Mac OS X (10.5.7)

Posted on Jun 3, 2009 8:14 AM

Reply
Question marked as Best reply

Posted on Jun 3, 2009 8:39 AM

The launchd daemon supports a key in '.plist' files named, 'Sockets', that is an array for the port(s) that the service should bind to -if it isn't defined in a configuration file. Some services may not start if you try to change the port in this fashion.

More info here:

http://developer.apple.com/documentation/Darwin/Reference/ManPages/man5/launchd. plist.5.html
2 replies
Question marked as Best reply

Jun 3, 2009 8:39 AM in response to Danathar

The launchd daemon supports a key in '.plist' files named, 'Sockets', that is an array for the port(s) that the service should bind to -if it isn't defined in a configuration file. Some services may not start if you try to change the port in this fashion.

More info here:

http://developer.apple.com/documentation/Darwin/Reference/ManPages/man5/launchd. plist.5.html

Jun 3, 2009 8:42 AM in response to Danathar

This is done within the <Listeners> section of your .plist:

<key>Listeners</key>
<array>
<dict>
<key>SockNodeName</key>
<string>127.0.0.1</string>
<key>SockServiceName</key>
<string>12345</string>
</dict>
</array>
</dict>


The above will setup a service to listen to port 12345 on localhost (127.0.0.1) only, not all addresses.

launchd and binding

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.