Comment 6 for bug 1819721

Revision history for this message
Sebastian (slovdahl) wrote :

Tiago,

Thank you for helping out!

Unfortunately, that doesn't work out of the box in our case. The reason is how our tomcat8.local currently is used. We have some sane defaults in /etc/default/tomcat8 that Puppet manages, and use /etc/default/tomcat8.local to make it possible to override it locally like this:

$ cat /etc/default/tomcat8.local
JAVA_OPTS="${JAVA_OPTS} -Xmx3g"

It seems like systemd doesn't like that line at all, tomcat fails to start after creating an override.conf as you suggested:

$ sudo systemctl status tomcat8
● tomcat8.service - Apache Tomcat 8.5 Web Application Server
   Loaded: loaded (/lib/systemd/system/tomcat8.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/tomcat8.service.d
           └─override.conf
   Active: failed (Result: exit-code) since Tue 2019-04-09 07:28:51 UTC; 5s ago
     Docs: https://tomcat.apache.org/tomcat-8.5-doc/index.html
  Process: 5788 ExecStart=/bin/sh /usr/libexec/tomcat8/tomcat-start.sh (code=exited, status=1/FAILURE)
  Process: 5777 ExecStartPre=/usr/libexec/tomcat8/tomcat-update-policy.sh (code=exited, status=0/SUCCESS)
 Main PID: 5788 (code=exited, status=1/FAILURE)

apr 09 07:28:51 ubuntu1804base systemd[1]: Starting Apache Tomcat 8.5 Web Application Server...
apr 09 07:28:51 ubuntu1804base systemd[1]: Started Apache Tomcat 8.5 Web Application Server.
apr 09 07:28:51 ubuntu1804base tomcat8[5788]: Error: Could not find or load main class ${JAVA_OPTS}
apr 09 07:28:51 ubuntu1804base systemd[1]: tomcat8.service: Main process exited, code=exited, status=1/FAILURE
apr 09 07:28:51 ubuntu1804base systemd[1]: tomcat8.service: Failed with result 'exit-code'.

There are probably other ways to achieve what we currently do with tomcat8.local using systemd, but having to convert all our currently deployed /etc/default/tomcat8.local files would require a lot of manual work. In addition to that, we might have to introduce a new Puppet class for Ubuntu 18.04 + Tomcat 8 and use that one for the servers that have an updated Tomcat 8, and let the old one be used on all servers without an updated Tomcat 8.

I'm still of the opinion that this kind of change in the middle of an LTS cycle is far too intrusive.