These instructions use jsvc to daemonize Tomcat. This is the more UNIX method of starting Tomcat at boot time.
Unpack the java server daemon JSVC
The Java Server Daemon JSVC source code is included with the Tomcat 6.0.x binary release.
# Change directories to the Tomcat home directory
# Unpack the jsvc archive
tar -xvzf commons-daemon-native.tar.gz
# Change directories to the unpacked source directory
Execute the following commands to build the jsvc daemon and copy the daemon executable and startup script to the Tomcat bin directory.
The OS X developer tools must be installed.
# Create the configure file
# Create the make file (JAVA 5)
# Create the make file (JAVA 6)
# Build jsvc
# Move jsvc into bin
mv jsvc ../..
# Copy the jsvc startup script into bin
cp samples/Tomcat5.sh ../..
# Change directories into bin
# Add execute permissions to Tomcat5.sh
chmod 750 Tomcat5.sh
Edit the daemon startup script Tomcat5.sh
# Edit Tomcat5.sh
# Make sure the following environment variables are set correctly in
# the Tomcat5.sh startup script for your installation. It is recommended that you run
# Tomcat as a user other than root as to restrict Tomcat's access to the host machine.
# for multi instances adapt those lines.
case "$1" in
# Start Tomcat
# Stop Tomcat
Start Tomcat as a Daemon
# Execute the startup script to start Tomcat as a daemon
# You must execute the daemon as root as it writes the
# daemon's process id to /var/run.
# If Tomcat is already running, first stop it.
sudo ./Tomcat5.sh start
# Check and see if it is running
# To stop the server ...
sudo ./Tomcat5.sh stop
Starting Tomcat at Boot Time
If you would like Tomcat to start at boot time, create a Launchd property list to load JSVC. Download tomcat-plist.tar.gz and execute the following commands in terminal.
# Change directories to the LaunchDaemons directory
# Unpack the property list
sudo tar -xvzf ~/Downloads/tomcat-plist.tar.gz
# Make sure the property list is owned by root
sudo chown root org.apache.commons.jsvc.plist
sudo launchctl load /Library/LaunchDaemons/org.apache.commons.jsvc.plist