Bug 48793 - catalina.sh: "stop" errors on HP-UX
Summary: catalina.sh: "stop" errors on HP-UX
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Native:Packaging (show other bugs)
Version: 6.0.24
Hardware: HP HP-UX
: P2 normal (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2010-02-22 13:58 UTC by Thomas GL
Modified: 2010-05-14 15:48 UTC (History)
0 users

Fix for some "[ $? -eq 1 ]" tests (900 bytes, application/octet-stream)
2010-02-22 13:58 UTC, Thomas GL

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas GL 2010-02-22 13:58:40 UTC
Created attachment 25035 [details]
Fix for some "[ $? -eq 1 ]" tests


In SVN commit 810611, the following shell pattern have used a few times in "catalina.sh":

    kill -0 $pid
    if [ $? -eq 1 ]; then
       ... OK, the process is dead ...

On HP-UX (11.11 here), this does not work as expected, because kill ("/usr/bin/kill" actually, it's not shell a built-in) returns 2 when the PID doesn't exist, and not 1 as assumed above.
It would be better to rewrite these tests like this :

   if [ $? -gt 0 ]; then 

A patch follows (made against 6.0.24).
Comment 1 Mark Thomas 2010-03-10 16:48:54 UTC
Thanks for the patch. It has been applied to trunk and proposed for 6.0.x
Comment 2 Mark Thomas 2010-05-14 15:48:44 UTC
Thanks again for the patch. The patch has been applied to 6.0.x and will be included in 6.0.27 onwards.