init script doesn't handle hanging tomcat processes

Bug #1465691 reported by Stefan Himpich
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tomcat7 (Ubuntu)
Undecided
Unassigned
tomcat8 (Ubuntu)
Undecided
Unassigned
tomcat9 (Ubuntu)
Undecided
Unassigned

Bug Description

Ubuntu version:

Description: Ubuntu 14.04.1 LTS
Release: 14.04
--------------------------------------------------------
package version:

tomcat7:
  Installed: 7.0.52-1ubuntu0.1
  Candidate: 7.0.52-1ubuntu0.1
  Version table:
 *** 7.0.52-1ubuntu0.1 0
--------------------------------------------------------
Expected:
when the start-stop-daemon fails to stop the process (e.g. Java VM stuck), it returns 2. I expect the script to return an error message, exit code != 0 and not remove the PID file.

--------------------------------------------------------
Happens:
The init script checks the return codes for start-stop-daemon and handles "1" and "3" correctly. All others are handled like a "0":
- pid file removed
- exitcode of the init script is "0"

Revision history for this message
Stefan Himpich (tmm) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch which handles errorcode 2" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Henrik Alstad (henrikalstad) wrote :

This is indeed an issue.
Usually it's not a problem, since the default script does a SIGKILL, but when I removed that from the program, the init-script failed to fail, when the process didnt shutdown through the normal SIGTERM. This caused me quite a bit of debugging.

Emmanuel Bourg (ebourg)
Changed in tomcat7 (Ubuntu):
status: New → Confirmed
Changed in tomcat8 (Ubuntu):
status: New → Confirmed
Revision history for this message
Nish Aravamudan (nacc) wrote :

@tmm, this seems like a reversed patch (the debdiff shows the -eq 2 stanza being removed not added).

Are you able to file this bug with Debian, as it seems like it would also be an issue there.

Mathew Hodson (mhodson)
tags: added: trusty
Nish Aravamudan (nacc)
Changed in tomcat7 (Ubuntu):
status: Confirmed → Incomplete
Changed in tomcat8 (Ubuntu):
status: Confirmed → Incomplete
Changed in tomcat7 (Ubuntu):
status: Incomplete → Confirmed
Changed in tomcat8 (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

FYI in tomcat9 this works fine, it is all in systemd and fail to shut down will be detected and handled. The old script does not exist there anymore - only tomcat9.service.

I know that does not help 7 or 8, but for the sake of cleaning up old bug that is an FYI worth sharing.

Changed in tomcat9 (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers