Use Launchd for starting Tor on OS X
Launchd allows to fire up Tor as soon as the port that Tor is being assigned to is being contacted. As an initial setup, add this code as a file named org.tor.plist into the directory called /Library/LaunchAgents:
Label org.tor ProgramArguments tor<key>OnDemand</key>
<true/>
<key>Sockets</key>
<dict>
<key>Listeners</key>
<dict>
<key>SockServiceName</key>
<string>9050</string>
</dict>
</dict>
<key>TimeOut</key>
<integer>600</integer>
Of course, the TimeOut feature is discussible and can be omitted. Its usefulness depends mainly on the question how hard it is to fire up Tor. The easier it is, the more usefl this option will be.
This will work already! But you will have to hit the reload button upon first access to Tor, as the first access is swallowed by Launchd.
Launchd can give you the initial request with a couple of simple API calls. The source code package of launchd brings a decent example. Download it here:
http://www.opensource.apple.com/darwinsource/tarballs/other/launchd-152.tar.gz
It will contain a file called sample.c. It's easy to understand and should pretty much be exactly what needs to be pasted into the Tor binary.
Altogether, this will take no longer than 10 minutes but will make life a little happier!
Igel
[Automatically added by flyspray2trac: Operating System: OSX 10.4 Tiger]
Trac:
Username: igel