Bug 464145

Summary: Getting the status of a tomcat5 service does not work with a different user than tomcat
Product: Red Hat Enterprise Linux 5 Reporter: karl.scheibelhofer
Component: tomcat5Assignee: David Knox <dknox>
Status: CLOSED CURRENTRELEASE QA Contact: tomcat-qe
Severity: medium Docs Contact:
Priority: medium    
Version: 5.2CC: jclere, jpechane, mhasko
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-16 13:27:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description karl.scheibelhofer 2008-09-26 14:03:37 UTC
Description of problem:

Calling "/etc/init.d/tomcat5 status" does not work if the user running a second tomcat instance has a name different to "tomcat".

Version-Release number of selected component (if applicable):
Server version: Apache Tomcat/5.5.23
Server built:   Aug 22 2008 12:27:59
Server number:  5.5.23.0

How reproducible:

Steps to Reproduce:
1. Create a second tomcat5 instance with a own start/stop script, e.g. /etc/init.d/tomcat5app
2. Set TOMCAT_USER for the second instant to a different user than "tomcat"
2. start tomcat5app
3. get its state with "/etc/init.d/tomcat5app status"
  
Actual results:
/etc/init.d/tomcat5app running (14464) but no PID file exists

Expected results:
/etc/init.d/tomcat5app is already running (14464)

Additional info:
The problem is in the script /etc/init.d/tomcat5 in function status() in the line

        pid="$(pgrep -u tomcat java)"

which should be something like this

        pid="$(pgrep -u $TOMCAT_USER java)"

Comment 1 David Knox 2010-07-07 16:38:03 UTC
Including this in LSB compliance work on init scripts

Comment 2 Michal Haško 2013-01-16 13:27:54 UTC
Works in tomcat5-5.5.23-0jpp.37.el5.