Bug 464145 - Getting the status of a tomcat5 service does not work with a different user than tomcat
Summary: Getting the status of a tomcat5 service does not work with a different user t...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: tomcat5
Version: 5.2
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: David Knox
QA Contact: tomcat-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-09-26 14:03 UTC by karl.scheibelhofer
Modified: 2015-11-02 00:15 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-01-16 13:27:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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.


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