Bug 54013 - Catalina.sh force kill to wait till process exits completely
Summary: Catalina.sh force kill to wait till process exits completely
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: trunk
Hardware: All Linux
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-16 09:21 UTC by mukarram.baig
Modified: 2013-07-01 14:38 UTC (History)
1 user (show)



Attachments
Patch for changes to catalina.sh to wait till process dies completely (1.37 KB, patch)
2012-10-16 09:21 UTC, mukarram.baig
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mukarram.baig 2012-10-16 09:21:49 UTC
Created attachment 29490 [details]
Patch for changes to catalina.sh to wait till process dies completely

In Tomcat 7, when the container is stopped using catalina.sh stop force, the catalina.sh script uses the CATALINA_PID environment variable to send a kill -9 to the pid of the currently running container process. However, this doesn't kill the process instantaneously - say for e.g. when the process is in the middle of a system call or is in the UNINTERRUPTIBLE state. In this case, why cant we use the kill -0 ``cat "$CATALINA_PID"`` >/dev/null 2>&1 trick of checking the liveness of the process before removing the PID file that is used with stop in the non-force mode? This would ensure that the stop force is somewhat synchronous. Just wanted to know if there are good reasons why this was not done. If we don't see any issue with this, I am attaching a patch (to catalina.sh) that is intended to do this. Let me know if there are any questions.

Thanks in advance!
Comment 1 Mark Thomas 2012-10-26 19:37:52 UTC
Comment on attachment 29490 [details]
Patch for changes to catalina.sh to wait till process dies completely

Fix MIME type
Comment 2 Mark Thomas 2013-07-01 14:38:32 UTC
Thanks for the patch. It has been applied to trunk and 7.0.x and will be included in 7.0.42 onwards.