3 function update_monitor() {
6 if [[ -f ${POLICY_HOME}/etc/monitor/monitor.cfg ]]; then
8 -e "s/^${COMPONENT}=.*/${COMPONENT}=${STATUS}/g" \
9 ${POLICY_HOME}/etc/monitor/monitor.cfg
13 # unmonitored stop, does not change monitor status (immutable)
15 cd ${TOMCAT_BASE}/bin/
16 ${TOMCAT_BASE}/bin/catalina.sh stop -force
19 pid=$(pgrep -f -u ${POLICY_USER} "${TOMCAT_RUNNING}" 2> /dev/null)
21 if [[ ${RETVAL} == 0 ]]; then
22 pkill -u ${POLICY_USER} -f "${TOMCAT_RUNNING}" -KILL
29 update_monitor ${{COMPONENT_TYPE}} off
32 # unmonitored start, does not change monitor status (immutable)
34 cd ${TOMCAT_BASE}/bin/
35 ${TOMCAT_BASE}/bin/catalina.sh start
41 if [[ ${RETVAL} != 0 ]]; then
42 update_monitor ${{COMPONENT_TYPE}} off
44 update_monitor ${{COMPONENT_TYPE}} on
48 TOMCAT_BASE=${POLICY_HOME}/servers/${{COMPONENT_TYPE}}
49 TOMCAT_RUNNING="^$JAVA_HOME/bin/java .* -Dcatalina.base=${TOMCAT_BASE} .* start$"
54 . ${POLICY_HOME}/etc/profile.d/env.sh
58 pid=$(pgrep -f -u ${POLICY_USER} "${TOMCAT_RUNNING}" 2> /dev/null)
60 if [ $RETVAL -eq 0 ]; then
61 echo "running with pid ${pid}"
84 cd ${TOMCAT_BASE}/bin/
85 ${TOMCAT_BASE}/bin/catalina.sh "$@"