There are two fundamental problems with the status command. 1) It reports a tomcat instance as running when the instance isn't running and reports pids which do not belong to the instance. 2) It does not respect the CATALINA_PID file variable which is set in the per instance config file and instead hardcodes the pid file to /var/run/${NAME}.pid Problem 1 occurs when there are multiple tomcat instances on the system. The status command checks for the presence of /var/run/${NAME}.pid, if the pid file is not present it is supposed to indicate the instance is stopped. But instead if /var/run/${NAME}.pid is not present it uses pgrep to search the process table for any java process running with the TOMCAT_USER uid and gid. When there are multiple instances pgrep will return a list of pids for each instance. However, none of those instances are the instance whose status we're checking. Thus it reports the instance is running, but that is not correct, the instance is not running but other instances are and it's those instances whose pid's are reported. Problem 2 occurs whenever the instance config does not use the same pid file default encoded in the initscript. For example we group our pids in a subdirectory of /var/run specific to the application. Ideally we would like to use the lsb status command and not implement the status command in our initscript. However the lsb status command takes as one of it's arguments the process name. However we don't know the process name because it's set in the wrapper via set_javacmd and that process name is not known in the initscript. Attached is a patch which reimplements the status command following the LSB guidelines, and respects the CATALINA_PID variable.
Created attachment 495617 [details] reimplement status command, respect CATALINA_PID
As a reference this problem was observed in bug #689858, that bug now depends on this bug.
tomcat6-6.0.32-1.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/tomcat6-6.0.32-1.fc15
Package tomcat6-6.0.32-1.fc15: * should fix your issue, * was pushed to the Fedora 15 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing tomcat6-6.0.32-1.fc15' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/tomcat6-6.0.32-1.fc15 then log in and leave karma (feedback).
tomcat6-6.0.32-2.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/tomcat6-6.0.32-2.fc15
tomcat6-6.0.32-4.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/tomcat6-6.0.32-4.fc15
tomcat6-6.0.32-8.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/tomcat6-6.0.32-8.fc15
tomcat6-6.0.32-17.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/tomcat6-6.0.32-17.fc16
tomcat6-6.0.32-17.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.
tomcat6-6.0.32-8.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.