Package: tomcat8
Version: 8.5.14-1+deb9u3
Severity: normal
Tags: patch

Dear Maintainer,

we run tomcat8 on a couple of hosts. Quite often we experience a failed
systemd service while tomcat is actually running, usually after a
reboot.

In detail this looks as follows:

root@kama[~]# systemctl status tomcat8.service 
● tomcat8.service - LSB: Start Tomcat.
   Loaded: loaded (/etc/init.d/tomcat8; generated; vendor preset:
   enabled)
   Active: failed (Result: exit-code) since Tue 2019-02-19 17:22:35
      CET; 17h ago
     Docs: man:systemd-sysv-generator(8)
  Process: 606 ExecStart=/etc/init.d/tomcat8 start
             (code=exited, status=1/FAILURE)
    Tasks: 358 (limit: 4915)
   CGroup: /system.slice/tomcat8.service
           └─726 /usr/lib/jvm/default-java/bin/java
       -Djava.util.logging.config.file=/var/lib/tomcat8/conf/logging.properties
       -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
       -Djava.awt.headless=true
       -XX:+UseConcMarkSweepGC
       -Djava.security.egd=file:/dev/./urandom
       -XX:MaxPermSize=512m -Xms1024m -Xmx2048m
       -Dcom.sun.management.jmxremote
       -Dcom.sun.management.jmxremote.ssl=false
       -Dcom.sun.management.jmxremote.authenticate=true
       -Dcom.sun.management.jmxremote.port=1098
       
-Dcom.sun.management.jmxremote.password.file=/etc/tomcat8/jmxremote.password
       -Dcom.sun.management.jmxremote.access.file=/etc/tomcat8/jmxremote.access
       -Djsse.enableSNIExtension=false
       -Djdk.tls.ephemeralDHKeySize=2048
       -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
       -classpath
       
/usr/share/tomcat8/bin/bootstrap.jar:/usr/share/tomcat8/bin/tomcat-juli.jar
       -Dcatalina.base=/var/lib/tomcat8
       -Dcatalina.home=/usr/share/tomcat8
       -Djava.io.tmpdir=/tmp/tomcat8-tomcat8-tmp
       org.apache.catalina.startup.Bootstrap
       start

Feb 19 17:22:30 kama systemd[1]: Starting LSB: Start Tomcat....
Feb 19 17:22:35 kama tomcat8[606]: Starting Tomcat servlet engine: tomcat8
failed!
Feb 19 17:22:35 kama systemd[1]: tomcat8.service: Control process exited,
code=exited status=1
Feb 19 17:22:35 kama systemd[1]: Failed to start LSB: Start Tomcat..
Feb 19 17:22:35 kama systemd[1]: tomcat8.service: Unit entered failed
state.
Feb 19 17:22:35 kama systemd[1]: tomcat8.service: Failed with result
'exit-code'.

As you can see it takes exactly 5 seconds between starting tomcat and
deciding that it failed to start. This correlates to the "sleep 5"
command in the start script. Simply changing this to 10 seconds makes
the script succeed.

As Debian Buster does not use this start script any more this patch only
applies to stretch and older releases (same problem on jessie and even
wheezy, with tomcat6 or 7 there).

Thanks,

Christopher

-- System Information:
Debian Release: 9.8
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-8-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages tomcat8 depends on:
ii  adduser                3.115
ii  debconf [debconf-2.0]  1.5.61
ii  lsb-base               9.20161125
ii  tomcat8-common         8.5.14-1+deb9u3
ii  ucf                    3.0036

Versions of packages tomcat8 recommends:
pn  authbind       <none>
pn  libtcnative-1  <none>

Versions of packages tomcat8 suggests:
ii  tomcat8-admin     8.5.14-1+deb9u3
pn  tomcat8-docs      <none>
pn  tomcat8-examples  <none>
pn  tomcat8-user      <none>

-- debconf information excluded
--- tomcat8.ORIG        2019-02-20 10:43:43.673084352 +0100
+++ tomcat8     2019-02-20 10:43:51.553090214 +0100
@@ -218,7 +218,7 @@
                chown -h $TOMCAT8_USER "$JVM_TMP"
 
                catalina_sh start $SECURITY
-               sleep 5
+               sleep 10
                if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \
                        --user $TOMCAT8_USER --exec "$JAVA_HOME/bin/java" \
                        >/dev/null; then

Reply via email to