wiki:UsingStartupItemContext

Similar to UsingLaunchd, this is a way to launch a buildslave on a mac without losing DNS resolution.

First, write a script that will start the buildslave - in this example, /opt/buildslave/start. It should be designed to run as root, and to assume the identity of the proper buildslave user.

Then, invoke it as

/usr/libexec/StartupItemContext /opt/buildslave/start

StartupItemContext? can be invoked anywhere, as root - from an SSH connection, or from an automated process such as cron or cfengine.