Bug 464145 - Getting the status of a tomcat5 service does not work with a different user than tomcat
Getting the status of a tomcat5 service does not work with a different user t...
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: tomcat5 (Show other bugs)
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: David Knox
Depends On:
  Show dependency treegraph
Reported: 2008-09-26 10:03 EDT by karl.scheibelhofer
Modified: 2015-11-01 19:15 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-01-16 08:27:54 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description karl.scheibelhofer 2008-09-26 10:03:37 EDT
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:

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 12:38:03 EDT
Including this in LSB compliance work on init scripts
Comment 2 Michal Haško 2013-01-16 08:27:54 EST
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.