Bug 746842 - checkpidfile does not return correctly
Summary: checkpidfile does not return correctly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: tomcat6
Version: 6.0
Hardware: noarch
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: David Knox
QA Contact: tomcat-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-17 22:50 UTC by Michael McEniry
Modified: 2015-11-02 00:16 UTC (History)
5 users (show)

Fixed In Version: tomcat6-6.0.24-84.el6
Doc Type: Bug Fix
Doc Text:
Previously, in /etc/init.d/tomcat6, the checkpidfile function did not return correct values when the PID file and a matching /proc/${kpid} existed. This caused the status function to use pgrep to look for processes, which showed any other java processes running as the same user. A fix has been applied, and the checkpidfile function now works as expected.
Clone Of:
Environment:
Last Closed: 2015-07-22 07:27:13 UTC


Attachments (Terms of Use)
fix to /etc/init.d/tomcat6, checkpidfile, to return correctly (348 bytes, text/plain)
2011-10-17 22:50 UTC, Michael McEniry
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1461 normal SHIPPED_LIVE tomcat6 bug fix and enhancement update 2015-07-21 14:14:55 UTC

Description Michael McEniry 2011-10-17 22:50:39 UTC
Created attachment 528666 [details]
fix to /etc/init.d/tomcat6, checkpidfile, to return correctly

Description of problem:
In /etc/init.d/tomcat6, the checkpidfile function does not return correctly, when the pid file exists and the matching /proc/${kpid} exists. It sets RETVAL="0", then proceeds out of the nested "if" blocks and sets RETVAL="3". This causes the status function to use pgrep to look for processes, which shows any other java processes running as the same user.


Version-Release number of selected component (if applicable):
tomcat6-6.0.24-33.el6.noarch


How reproducible:
Always


Steps to Reproduce:
1. Create another java process (eg, a second tomcat instance) that runs as the same user and group ("tomcat" by default).
2. service tomcat6 status
  
Actual results:
tomcat6 (pid 6824,61491) is running...  [  OK  ]

Expected results:
tomcat6 (pid 6824) is running...  [  OK  ]


Additional info:
Place a "return" after setting RETVAL="0", as in attached diff.

Comment 2 RHEL Product and Program Management 2011-10-17 23:08:37 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 6 errata-xmlrpc 2015-07-22 07:27:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1461.html


Note You need to log in before you can comment on or make changes to this bug.