Page 1 of 1

Tomcat 9 startup at server start

PostPosted: Tue Oct 08, 2019 9:57 am
by huber
I try to automatically startup Tomcat 9 (9.0.26) with LaunchDaemon on macOS Mojave. My LaunchDaemon "org.apache.tomcat.plist" property list file looks like as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>org.apache.tomcat</string>
<key>ServiceDescription</key>
<string>Tomcat</string>
<key>UserName</key>
<string>root</string>
<key>GroupName</key>
<string>wheel</string>
<key>EnvironmentVariables</key>
<dict>
<key>CATALINA_HOME</key>
<string>/Library/Tomcat</string>
<key>JAVA_HOME</key>
<string>/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home</string>
</dict>
<key>ProgramArguments</key>
<array>
<string>/Library/Tomcat/bin/startup.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>


The file is placed in /Library/LaunchDaemons folder and has root:wheel as owner:group settings (tried also with admin:wheel, admin:staff etc. with no success).

Unfortunately, Tomcat won't startup. I have not problem starting and stopping Tomcat in a Terminal with following commands (where "Tomcat" is a sym link to the tomcat installation)
/Library/Tomcat/bin/startup.sh

/Library/Tomcat/bin/catalina.sh stop


So manually sorting and stopping works well. This is also true when using a Mac utility called Tomcat Controller.

Anyone having a property list for Tomcat 9 which works and is willing to share?

Regards,

Re: Tomcat 9 startup at server start

PostPosted: Fri Oct 11, 2019 9:18 am
by huber
Tomcat 9 - anyone?

Re: Tomcat 9 startup at server start

PostPosted: Fri Oct 11, 2019 2:30 pm
by mboegem
Hi Robert,

have a look here, it might help you: https://superuser.com/questions/130802/how-to-re

Re: Tomcat 9 startup at server start

PostPosted: Tue Oct 15, 2019 9:09 am
by huber
Hi Marc

Thanks for your link. I tried many of the hints described there but with no luck. Strange thing is that manually starting the startup.sh script is no problem, as well as stopping. But I don't get it to run with LaunchDaemon and loading it into Launchctl list. Tried also all sorts of owner:group combination, as it seemed to me it could have to do with bad ownership. But also without luck. I have been run out of ideas where the problem could be, therefor anyone who is able to start the java process with the LaunchDaemon would be helpful to know.

mboegem wrote:Hi Robert,

have a look here, it might help you: https://superuser.com/questions/130802/how-to-re


Regards,