Blame SOURCES/tomcat-functions

295e28
#!/bin/bash
295e28
295e28
if [ -r /usr/share/java-utils/java-functions ]; then
295e28
  . /usr/share/java-utils/java-functions
295e28
else
295e28
  echo "Can't read Java functions library, aborting"
295e28
  exit 1
295e28
fi
295e28
295e28
_save_function() {
295e28
    local ORIG_FUNC=$(declare -f $1)
295e28
    local NEWNAME_FUNC="$2${ORIG_FUNC#$1}"
295e28
    eval "$NEWNAME_FUNC"
295e28
}
295e28
295e28
run_jsvc(){
295e28
    if [ -x /usr/bin/jsvc ]; then
295e28
	TOMCAT_USER="tomcat"
295e28
       	JSVC="/usr/bin/jsvc"
295e28
	
295e28
	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"
295e28
	if [ "$1" = "stop" ]; then
295e28
		JSVC_OPTS="${JSVC_OPTS} -stop"
295e28
    	fi
295e28
295e28
        exec "${JSVC}" ${JSVC_OPTS} ${FLAGS} -classpath "${CLASSPATH}" ${OPTIONS} "${MAIN_CLASS}" "${@}"
295e28
    else
295e28
       	echo "Can't find /usr/bin/jsvc executable"
295e28
    fi
295e28
295e28
}
295e28
295e28
_save_function run run_java
295e28
295e28
run() {
295e28
   if [ "${USE_JSVC}" = "true" ] ; then
295e28
	run_jsvc $@
295e28
   else
295e28
	run_java $@
295e28
   fi
295e28
}
295e28