Bug 1104708
Summary: | Tomcat init script does not respect setting of CATALINA_PID in /etc/sysconfig/tomcat | |||
---|---|---|---|---|
Product: | [Fedora] Fedora EPEL | Reporter: | C. Morgan Hamill <chamill> | |
Component: | tomcat | Assignee: | Coty Sutherland <csutherl> | |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | |
Severity: | unspecified | Docs Contact: | ||
Priority: | unspecified | |||
Version: | el6 | CC: | csutherl, ivan.afonichev, nkadel, slp.vld | |
Target Milestone: | --- | |||
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | tomcat-7.0.70-2.el6 | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1304220 (view as bug list) | Environment: | ||
Last Closed: | 2016-09-02 09:22:34 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1304220 |
Description
C. Morgan Hamill
2014-06-04 14:18:44 UTC
The patch for this is below. diff -ur tomcat-7.0.33-4.el6.pid/etc/init.d/tomcat tomcat-7.0.33-4.el6/etc/init.d/tomcat --- tomcat-7.0.33-4.el6.pid/etc/init.d/tomcat 2014-12-03 10:12:51.689838620 -0500 +++ tomcat-7.0.33-4.el6/etc/init.d/tomcat 2014-12-03 10:10:49.812736936 -0500 @@ -69,6 +69,8 @@ # Define the tomcat log file TOMCAT_LOG="${TOMCAT_LOG:-${CATALINA_HOME}/logs/${NAME}-initd.log}" +# Define the tomcat pid file +CATALINA_PID="${CATALINA_PID:-/var/run/${NAME}.pid}" RETVAL="0" @@ -162,7 +164,6 @@ fi fi # fix permissions on the log and pid files - export CATALINA_PID="/var/run/${NAME}.pid" touch $CATALINA_PID 2>&1 || RETVAL="4" if [ "$RETVAL" -eq "0" -a "$?" -eq "0" ]; then chown ${TOMCAT_USER}:${TOMCAT_USER} $CATALINA_PID @@ -210,8 +211,8 @@ fi if [ "$RETVAL" -eq "0" ]; then count="0" - if [ -s "/var/run/${NAME}.pid" ]; then - read kpid < /var/run/${NAME}.pid + if [ -s "$CATALINA_PID" ]; then + read kpid < $CATALINA_PID until [ "$(ps --pid $kpid | grep -c $kpid)" -eq "0" ] || \ [ "$count" -gt "$SHUTDOWN_WAIT" ]; do if [ "$SHUTDOWN_VERBOSE" = "true" ]; then @@ -228,7 +229,7 @@ fi log_success_msg fi - rm -f /var/lock/subsys/${NAME} /var/run/${NAME}.pid + rm -f /var/lock/subsys/${NAME} $CATALINA_PID else log_failure_msg RETVAL="4" @@ -262,7 +263,7 @@ start ;; condrestart|try-restart) - if [ -s "/var/run/${NAME}.pid" ]; then + if [ -s "$CATALINA_PID" ]; then stop start fi @@ -271,14 +272,14 @@ RETVAL="3" ;; force-reload) - if [ -s "/var/run/${NAME}.pid" ]; then + if [ -s "$CATALINA_PID" ]; then stop start fi ;; status) - if [ -s "/var/run/${NAME}.pid" ]; then - read kpid < /var/run/${NAME}.pid + if [ -s "$CATALINA_PID" ]; then + read kpid < $CATALINA_PID if [ -d "/proc/${kpid}" ]; then log_success_msg "${NAME} (pid ${kpid}) is running..." RETVAL="0" https://github.com/csutherl/fedora-tomcat/commit/017ab53 There was one missing /var/run/${NAME}.pid usage in the above patch, but other than that (which I added in the above commit) it looks good. This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions tomcat-7.0.70-2.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-3ff1f4485b tomcat-7.0.70-2.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-3ff1f4485b tomcat-7.0.70-2.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report. tomcat-7.0.70-2.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report. |