[Bug 63041] New: shutdown.sh exits non 0 requires KILLSIG from OS

classic Classic list List threaded Threaded
37 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Bug 63041] New: shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

            Bug ID: 63041
           Summary: shutdown.sh exits non 0 requires KILLSIG from OS
           Product: Tomcat 9
           Version: 9.0.14
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: -----

Tomcat 9.0.14 shutdown.sh produces stack trace, non 0 exit code.  startup.sh
not releasing port 8005?  Tomcat 9.0.13 and all previous versions start and
stop normally.

Dec 28, 2018 9:57:32 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Error stopping Catalina
java.net.ConnectException: Connection refused (Connection refused)
        at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
        at
java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
        at
java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
        at
java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
        at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
        at java.base/java.net.Socket.connect(Socket.java:591)
        at java.base/java.net.Socket.connect(Socket.java:540)
        at java.base/java.net.Socket.<init>(Socket.java:436)
        at java.base/java.net.Socket.<init>(Socket.java:213)
        at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:513)
        at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:403)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:497)

Environment:
Server version name:   Apache Tomcat/9.0.14
OS Name:               Linux
OS Version:            4.15.0-43-generic
Architecture:          amd64
JVM Version:           11.0.1+13
Tomcat Native library [1.2.19] using APR version [1.6.5]

How to reproduce:  Download and install Tomcat 9.0.14.  Start it using
startup.sh.  Stop it using shutdown.sh.  Stack trace observed on Linux and
MacOS.  There are no user webapps involved.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

Christopher Schultz <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #1 from Christopher Schultz <[hidden email]> ---
The shutdown process is unable to connect to a running Tomcat server over the
expected port. This is likely to be a configuration issue.

Bugzilla is not a support forum. Please post to the Tomcat users' mailing list,
instead.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

Steve Demy <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |---
             Status|RESOLVED                    |REOPENED

--- Comment #2 from Steve Demy <[hidden email]> ---
Tomcat 9.0.14 runs as expected using a transplanted 9.0.13 catalina.sh.  It
starts, stops and restarts using systemd (systemctl start|stop|restart tomcat).
 When the server is running netstat shows:

tcp6       0      0 :::8080                 :::*                    LISTEN    
1038/java          
tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN    
1038/java          
tcp6       0      0 :::8009                 :::*                    LISTEN    
1038/java          
unix  2      [ ]         STREAM     CONNECTED     21567    1038/java

OTOH, using the 9.0.14 version of catalina.sh, and after a fresh system reboot,
Tomcat starts normally (similar netstat results) until the first stop.  Any
subsequent start results in a start/stop loop where the server is running only
momentarily during each 10s restart loop.

Configuration is default.  There are no user webapps nor changes to the default
conf/server.xml file.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

--- Comment #3 from Igal Sapir <[hidden email]> ---
(In reply to Steve Demy from comment #2)
> Tomcat 9.0.14 runs as expected using a transplanted 9.0.13 catalina.sh.  It
> starts, stops and restarts using systemd (systemctl start|stop|restart
> tomcat).  

So if you take catalina.sh from 9.0.13 it works fine but with catalina.sh
9.0.14 you experience this issue?  All other factors are the same?

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

--- Comment #4 from Igal Sapir <[hidden email]> ---
I will look into this issue if no one else has already started

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

--- Comment #5 from Christopher Schultz <[hidden email]> ---
On the users' mailing list, I asked Steve to try the catalina.sh from 9.0.13 on
his 9.0.14 install, but there has been no reply for a few days.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

--- Comment #6 from Igal Sapir <[hidden email]> ---
(In reply to Christopher Schultz from comment #5)
> On the users' mailing list, I asked Steve to try the catalina.sh from 9.0.13
> on his 9.0.14 install, but there has been no reply for a few days.

He wrote this in comment #2, possibly replying in the "wrong" thread:
> Tomcat 9.0.14 runs as expected using a transplanted 9.0.13 catalina.sh

At first glance it looks like a regression from BZ-53930, which made quite a
few changes to catalina.sh, but I will dig deeper and update with my findings.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

--- Comment #7 from Igal Sapir <[hidden email]> ---
Possibly related to BZ-63063

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

--- Comment #8 from Patrik S. <[hidden email]> ---
Yes, BZ-63063 is exactly the same issue opened for tomcat 8.5 branch.
In tomcat 9.0 the catalina.sh contains at the same line 479 and 489 that faulty
code:

 2\>\&1 \& echo \$! \>\"$catalina_pid_file\" \; \} $catalina_out_command "&"

it needs to be

delimitered:
 2\>\&1 \; echo \$! \>\"$catalina_pid_file\" \; \} $catalina_out_command "&"
or logical AND:
 2\>\&1 \&\& echo \$! \>\"$catalina_pid_file\" \; \} $catalina_out_command "&"

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

--- Comment #9 from Igal Sapir <[hidden email]> ---
I can not reproduce the issue on Ubuntu 18.04 with Java 1.8.0_192

Tomcat shuts down immediately when calling shutdown.sh

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

--- Comment #10 from Mark Thomas <[hidden email]> ---
The issue isn't obvious but is observable on Ubuntu.

I agree that "\&" -> to "\&\&" is the correct fix. I'll get that implemented
and back-ported.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

Mark Thomas <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #11 from Mark Thomas <[hidden email]> ---
*** Bug 63063 has been marked as a duplicate of this bug. ***

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

Mark Thomas <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|REOPENED                    |RESOLVED

--- Comment #12 from Mark Thomas <[hidden email]> ---
Thanks for the report and to Patrik S. for the analysis.

This has been fixed in:
- trunk for 9.0.15 onwards
- 8.5.x for 8.5.38 onwards
- 7.0.x for 7.0.93 onwards

(note the bug was never present in a released version of 7.0.x)

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #13 from [hidden email] ---
(In reply to Mark Thomas from comment #10)
> The issue isn't obvious but is observable on Ubuntu.
>
> I agree that "\&" -> to "\&\&" is the correct fix. I'll get that implemented
> and back-ported.

This fix seems wrong. $! does not work after &&, only after &. Thus, the
correct PID cannot be obtained. Unfortunately, && and & mean something
completely different.

You can see this if you call "true & echo $!" versus "true && echo $!" several
times. The first one will always give different PIDs while the second one will
always give the same PID (may also be empty if nothing else was run in the
background before).

If I understand you correctly, you want to have the PID of nohup and you want
to write no PID file if nohup fails? I think this is non-trivial, because in
one case, the process is still running while in the other case it isn't. All
workarounds that came to my mind are very ugly, so I cannot provide a patch.

For me, the old catalina.sh works smoother than the new one.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

--- Comment #14 from [hidden email] ---
This fix seems to break the shell script /etc/init.d/tomcat I use to manage
Tomcat as a service with systemd (generated from init.d): https://git.io/fhQv4

Output follows:

$ sudo service tomcat start
Job for tomcat.service failed because the control process exited with error
code.
See "systemctl status tomcat.service" and "journalctl -xe" for details.

$ systemctl status tomcat.service
● tomcat.service - LSB: Start Tomcat.
   Loaded: loaded (/etc/init.d/tomcat; generated; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2019-02-10 21:11:07 CET; 7s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 4938 ExecStop=/etc/init.d/tomcat stop (code=exited,
status=0/SUCCESS)
  Process: 5066 ExecStart=/etc/init.d/tomcat start (code=exited,
status=1/FAILURE)
   CGroup: /system.slice/tomcat.service
           ├─5094 /bin/sh /opt/tomcat/bin/catalina.sh start
           └─5095 /usr/lib/jvm/java-8-oracle/bin/java
-Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
Feb 10 21:11:02 raspberrypi systemd[1]: Starting LSB: Start Tomcat....
Feb 10 21:11:07 raspberrypi tomcat[5066]: Starting Tomcat servlet engine:
tomcat failed!
Feb 10 21:11:07 raspberrypi systemd[1]: tomcat.service: Control process exited,
code=exited status=1
Feb 10 21:11:07 raspberrypi systemd[1]: Failed to start LSB: Start Tomcat..
Feb 10 21:11:07 raspberrypi systemd[1]: tomcat.service: Unit entered failed
state.
Feb 10 21:11:07 raspberrypi systemd[1]: tomcat.service: Failed with result
'exit-code'.

$ journalctl -xe
Feb 10 21:11:02 raspberrypi systemd[1]: Starting LSB: Start Tomcat....
-- Subject: Unit tomcat.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit tomcat.service has begun starting up.
Feb 10 21:11:07 raspberrypi tomcat[5066]: Starting Tomcat servlet engine:
tomcat failed!
Feb 10 21:11:07 raspberrypi systemd[1]: tomcat.service: Control process exited,
code=exited status=1
Feb 10 21:11:07 raspberrypi systemd[1]: Failed to start LSB: Start Tomcat..
-- Subject: Unit tomcat.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit tomcat.service has failed.
--
-- The result is failed.
Feb 10 21:11:07 raspberrypi systemd[1]: tomcat.service: Unit entered failed
state.
Feb 10 21:11:07 raspberrypi systemd[1]: tomcat.service: Failed with result
'exit-code'.

That /etc/init.d/tomcat script is a slightly modified version of the one
accompanying the Tomcat 8 package distributed with Debian APT.
It's worth noting that the server eventually starts despite the error, but I'm
not able to manage it as a service afterwards.
Now I'm using the old catalina.sh from v9.0.14 that works fine, but I'm
considering whether it is better to modify my script in order to support the
new catalina.sh or not.

Thanks for your great work.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

Thomas Opfer <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

--- Comment #15 from Thomas Opfer <[hidden email]> ---
(In reply to norad from comment #14)

This is the same problem I observed.

> Now I'm using the old catalina.sh from v9.0.14 that works fine, but I'm
> considering whether it is better to modify my script in order to support the
> new catalina.sh or not.

As far as I can see, the fix is just wrong as no PID file is written. I think
you should not modify anything. This should be fixed in catalina.sh. In my
Ubuntu PPA, I now use the old catalina.sh and it is working.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63041] shutdown.sh exits non 0 requires KILLSIG from OS

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

--- Comment #16 from Mark Thomas <[hidden email]> ---
Sigh. Sorry for the hassle. Sticking with catalina.sh from 9.0.14 is the way to
go if you are seeing issues.

We should be able to get this fixed for the next release. I don't know yet what
that fix will look like.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

12