Sunday, September 22, 2013

Use Launch Daemon to Start Tomcat Automatically on Mac

Start tomcat automatically on Mac.

1. create launchd_wrapper.sh at tomcat/bin
2. create /Library/LaunchDaemons/org.apache.tomcat.plist
3. restart your mac

Note: Replace "/Users/username/tomcat" with your tomcat path in launchd_wrapper.sh and plist file.

try to launch tomcat with the plist
"sudo launchctl load -w /Library/LaunchDaemons/org.apache.tomcat.plist"

If you got error: "launchctl: Dubious ownership on file (skipping)" [5]
Please try change owner and permission of the plist file
a. change the owner to root with "sudo chown root <filename>",
b. change the permissions with "sudo chmod 644 <filename>"
   (4 for read access, 2 for write access, 1 for execute access, added up. The first number is for the owner, the second for the group, the third for everyone.) 


-----  http://situee.blogspot.com ---------