pki-servlet-engine/tomcat-functions
Ivan Afonichev cee7beed0a Updated to 7.0.52
- Rewrite jsvc implementation, resolves: rhbz#1051743
- Switch to java-headless R, resolves: rhbz#1068566
- Create and own %{_localstatedir}/lib/tomcats, resolves: rhbz#1026741
- Add pom for tomcat-jdbc, resolves: rhbz#1011003
2014-03-26 03:34:21 +04:00

43 lines
943 B
Bash

#!/bin/bash
if [ -r /usr/share/java-utils/java-functions ]; then
. /usr/share/java-utils/java-functions
else
echo "Can't read Java functions library, aborting"
exit 1
fi
_save_function() {
local ORIG_FUNC=$(declare -f $1)
local NEWNAME_FUNC="$2${ORIG_FUNC#$1}"
eval "$NEWNAME_FUNC"
}
run_jsvc(){
if [ -x /usr/bin/jsvc ]; then
TOMCAT_USER="tomcat"
JSVC="/usr/bin/jsvc"
JSVC_OPTS="-nodetach -pidfile /var/run/jsvc-tomcat${NAME}.pid -user ${TOMCAT_USER} -outfile ${CATALINA_BASE}/logs/catalina.out -errfile ${CATALINA_BASE}/logs/catalina.out"
if [ "$1" = "stop" ]; then
JSVC_OPTS="${JSVC_OPTS} -stop"
fi
exec "${JSVC}" ${JSVC_OPTS} ${FLAGS} -classpath "${CLASSPATH}" ${OPTIONS} "${MAIN_CLASS}" "${@}"
else
echo "Can't find /usr/bin/jsvc executable"
fi
}
_save_function run run_java
run() {
if [ "${USE_JSVC}" = "true" ] ; then
run_jsvc $@
else
run_java $@
fi
}