Blame SOURCES/tomcat-functions

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