Launchd & TomcatLaunchd is amazing. It's predictable, simple, easy and correct. When Apple makes an app like Launchd in 2005, it makes me wonder what the hell Sun, HP and IBM were doing while improving UNIX for the last 30 years. Regardless it's my new favourite thing and it's much better than init.d and the Windows services system.
To get Tomcat started when your Mac boots, create a file called /Library/LaunchDaemons/org.apache.jakarta.tomcat.plist and fill it with the following XML. You'll need to change the paths to your Tomcat folder and use the Mac OS X user that Tomcat shall run as.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http:// www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Tomcat Startup Script, by Jesse Wilson, May 27, 2005 -->
<key>ServiceDescription</key> <string>Tomcat Server</string>