Launching Tomcat in Tiger

I run Tomcat on my PowerBook for my Java development work. Before Tiger, I had a StartupItem that would lanch Tomcat for me at system startup. This worked fairly well, but was a bit annoying because it launched Tomcat as root, so I'd have to use sudo to restart Tomcat, edit configuration files, etc. I also just don't like having services running as root if they don't need to be.

Once I got my hands on Tiger and read John Siracusa's glowing review of the new launchd service (part of his gi-normous review of Tiger) I thought I'd try my hand at creating a launchd configuration for Tomcat.

Since I want the Tomcat instance to run under my user account, I need to create a property list in my ~/Library/LaunchAgents folder with info on how to launch Tomcat. It took some trial and error, but I came up with this:


<?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">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>org.apache.jakarta.tomcat</string>
    <key>WorkingDirectory</key>
    <string>/Users/santry/Development/Services/jakarta-tomcat/bin</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Users/santry/Development/Services/jakarta-tomcat/ »
           bin/catalina.sh</string>
        <string>run</string>
    </array>
    <key>OnDemand</key>
    <false/>
    <key>RunAtLoad</key>
    <true/>
    <key>StandardOutPath</key>
    <string>/Users/santry/Development/Services/jakarta-tomcat/ »
        logs/catalina.out</string>
    <key>StandardErrorPath</key>
    <string>/Users/santry/Development/Services/jakarta-tomcat/ »
        logs/catalina.out</string>
    <key>Debug</key>
    <true/>
</dict>
</plist>