mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-27 00:57:50 +00:00
- has expired and reached EOL, unsupported upstream
http://tomcat.apache.org/security-5.html#Apache_Tomcat_5.x_vulnerabilities
This commit is contained in:
parent
9c9247c7b3
commit
3fd5079077
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=311329
1
MOVED
1
MOVED
@ -4018,3 +4018,4 @@ deskutils/py-dosage|deskutils/dosage|2013-01-28|Rename - it's a standalone appli
|
||||
textproc/clucene-contrib|textproc/clucene|2013-01-28|Integrated into textproc/clucene
|
||||
textproc/clucene-contrib|textproc/clucene|2013-01-28|Integrated into textproc/clucene
|
||||
lang/erlang14||2013-01-30|Not needed; no issues came up with R15
|
||||
www/tomcat55||2013-01-31|Has expired: EOL and unsupported upstream
|
||||
|
@ -1854,7 +1854,6 @@
|
||||
SUBDIR += tntnet
|
||||
SUBDIR += tokyopromenade
|
||||
SUBDIR += tomcat-native
|
||||
SUBDIR += tomcat55
|
||||
SUBDIR += tomcat6
|
||||
SUBDIR += tomcat7
|
||||
SUBDIR += trac
|
||||
|
@ -1,154 +0,0 @@
|
||||
# Created by: Kang Liu <liukang@bjpu.edu.cn>
|
||||
# $FreeBSD$
|
||||
|
||||
PORTNAME= tomcat
|
||||
PORTVERSION= 5.5.36
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= www java
|
||||
MASTER_SITES= ${MASTER_SITE_APACHE} \
|
||||
LOCAL/jgh
|
||||
MASTER_SITE_SUBDIR= tomcat/tomcat-5/v${PORTVERSION}/bin
|
||||
DISTNAME= apache-tomcat-${PORTVERSION}
|
||||
|
||||
MAINTAINER= jgh@FreeBSD.org
|
||||
COMMENT= Open-source Java web server by Apache, 5.5.x branch
|
||||
|
||||
OPTIONS_RADIO= LOG
|
||||
OPTIONS_RADIO_LOG= CRONOLOG CRONOLOG_DEVEL
|
||||
CRONOLOG_DESC= Use Cronolog for Log Processing
|
||||
CRONOLOG_DEVEL_DESC= Use Cronlog-Devel for Log Processing
|
||||
|
||||
DEPRECATED= EOL approaching, consider www/tomcat{6,7}
|
||||
EXPIRATION_DATE=2013-01-31
|
||||
|
||||
USE_JAVA= yes
|
||||
JAVA_VERSION?= 1.6+
|
||||
NO_BUILD= YES
|
||||
|
||||
USE_RC_SUBR= tomcat55
|
||||
SUB_FILES= pkg-install pkg-deinstall
|
||||
|
||||
MAJOR_VER= ${PORTVERSION:R}
|
||||
APP_HOME?= ${PREFIX}/${PKGBASE}${PORTVERSION:R}
|
||||
LOG_DIR= ${APP_HOME}/logs
|
||||
APP_TITLE= Apache Tomcat
|
||||
APP_SHORTNAME= tomcat${MAJOR_VER:S/.//}
|
||||
TOMCAT_USER?= www
|
||||
TOMCAT_GROUP?= www
|
||||
TOMCAT_UID?= 80
|
||||
HTTP_PORT?= 8180
|
||||
HTTP_TIMEOUT?= 20000
|
||||
SHUTDOWN_PORT?= 8005
|
||||
AJP_1_3_PORT?= 8009
|
||||
STDOUT_LOG= ${LOG_DIR}/stdout.log
|
||||
STDERR_LOG= ${LOG_DIR}/stderr.log
|
||||
PID_FILE= /var/run/${APP_SHORTNAME}.pid
|
||||
REPLACE_FILES= ${WRKSRC}/bin/catalina.sh \
|
||||
${WRKSRC}/conf/server.xml
|
||||
REPLACE_LIST_TEMP= ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/}
|
||||
JAR_FILE= bin/bootstrap.jar
|
||||
WRKDIR?= ${WRKDIRPREFIX}${.CURDIR}/work
|
||||
WRKSRC= ${WRKDIR}/apache-tomcat-${PORTVERSION}
|
||||
PLIST_SUB+= T=${APP_HOME:S/^${PREFIX}\///} WWWOWN=${TOMCAT_USER} WWWGRP=${TOMCAT_GROUP}
|
||||
LATEST_LINK= ${APP_SHORTNAME}
|
||||
CONF_EXT= sample
|
||||
PLIST_SUB+= CONF_EXT=${CONF_EXT}
|
||||
|
||||
SUB_LIST= AJP_1_3_PORT=${AJP_1_3_PORT} \
|
||||
APP_HOME=${APP_HOME} \
|
||||
APP_SHORTNAME=${APP_SHORTNAME} \
|
||||
APP_TITLE="${APP_TITLE}" \
|
||||
GROUP=${TOMCAT_GROUP} \
|
||||
HTTP_PORT=${HTTP_PORT} \
|
||||
HTTP_TIMEOUT=${HTTP_TIMEOUT} \
|
||||
JAR_FILE=${JAR_FILE} \
|
||||
JAVA_HOME=${JAVA_HOME} \
|
||||
LOG_ARGS=${LOG_ARGS} \
|
||||
LOG_DIR=${LOG_DIR} \
|
||||
PID_FILE=${PID_FILE} \
|
||||
PORTNAME=${PORTNAME} \
|
||||
SHUTDOWN_PORT=${SHUTDOWN_PORT} \
|
||||
STDERR_LOG=${STDERR_LOG} \
|
||||
STDOUT_LOG=${STDOUT_LOG} \
|
||||
TOMCAT_HOME=${APP_HOME} \
|
||||
TOMCAT_VERSION=${MAJOR_VER:S/.//} \
|
||||
USER=${TOMCAT_USER} \
|
||||
UID=${TOMCAT_UID}
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${JAVA_PORT_VERSION:C/^([0-9])\.([0-9])(.*)$/\1.\2/} == "1.4"
|
||||
DISTFILES+= apache-tomcat-${PORTVERSION}-compat.tar.gz
|
||||
PLIST_SUB+= JAVA14=""
|
||||
.else
|
||||
PLIST_SUB+= JAVA14="@comment "
|
||||
.endif
|
||||
|
||||
.if ${PORT_OPTIONS:MCRONOLOG}
|
||||
RUN_DEPENDS+= cronolog:${PORTSDIR}/sysutils/cronolog
|
||||
.endif
|
||||
|
||||
.if ${PORT_OPTIONS:MCRONOLOG_DEVEL}
|
||||
RUN_DEPENDS+= cronolog:${PORTSDIR}/sysutils/cronolog-devel
|
||||
.endif
|
||||
|
||||
.if empty(PORT_OPTIONS:MLOG)
|
||||
LOG_ARGS?=">> \$${tomcat\%\%TOMCAT_VERSION\%\%_stdout_log} 2>> \$${tomcat\%\%TOMCAT_VERSION\%\%_stderr_log}"
|
||||
.else
|
||||
LOG_ARGS?="2>\&1 | ${LOCALBASE}/sbin/cronolog --link \$${tomcat\%\%TOMCAT_VERSION\%\%_catalina_base}/logs/catalina.out \$${tomcat\%\%TOMCAT_VERSION\%\%_catalina_base}/logs/catalina.\%Y_\%m_\%d.out >/dev/null 2>\&1 \&"
|
||||
.endif
|
||||
|
||||
pre-patch:
|
||||
@${ECHO_MSG} "Installation settings:"
|
||||
@${ECHO_MSG} " Destination directory: ${APP_HOME}"
|
||||
@${ECHO_MSG} " Location of JDK: ${JAVA_HOME}"
|
||||
@${ECHO_MSG} " Location of Java port: ${JAVA_PORT}"
|
||||
@${ECHO_MSG} " Running as (user/group/uid): ${TOMCAT_USER}/${TOMCAT_GROUP}/${TOMCAT_UID}"
|
||||
@${ECHO_MSG} " HTTP port: ${HTTP_PORT}"
|
||||
@${ECHO_MSG} " Shutdown listener port: ${SHUTDOWN_PORT}"
|
||||
@${ECHO_MSG} " AJP 1.3 connector port: ${AJP_1_3_PORT}"
|
||||
@${ECHO_MSG} " Logfile stdout: ${STDOUT_LOG}"
|
||||
@${ECHO_MSG} " Logfile stderr: ${STDERR_LOG}"
|
||||
|
||||
@${ECHO_MSG} -n ">> Removing unneeded files..."
|
||||
@${FIND} ${WRKSRC} -type f \( -name '*.bak' -or -name '*.bat' -or -name '*.dll' -or -name '*.exe' -or -name '*.orig' \) -delete
|
||||
@${RMDIR} ${WRKSRC}/bin/[i,x]64
|
||||
@${ECHO_MSG} " [ DONE ]"
|
||||
|
||||
.for file in ${REPLACE_FILES}
|
||||
@${ECHO_MSG} -n ">> Customizing `basename ${file}`..."
|
||||
@${SED} ${REPLACE_LIST_TEMP} ${file} > ${WRKDIR}/`basename ${file}`
|
||||
@${ECHO_MSG} " [ DONE ]"
|
||||
.endfor
|
||||
|
||||
post-patch-script:
|
||||
@${ECHO_MSG} -n ">> Removing unneeded patched files..."
|
||||
@${FIND} ${WRKSRC} -type f \( -name '*.orig' \) -delete
|
||||
@${ECHO_MSG} " [ DONE ]"
|
||||
|
||||
do-install:
|
||||
@${ECHO_MSG} -n ">> Creating destination directory..."
|
||||
@${MKDIR} ${APP_HOME}
|
||||
@${MKDIR} ${LOG_DIR}
|
||||
@${ECHO_MSG} " [ DONE ]"
|
||||
|
||||
@${ECHO_MSG} ">> Copying files to destination directory..."
|
||||
@${CP} ${WRKDIR}/server.xml ${WRKSRC}/conf/
|
||||
@${CP} ${WRKDIR}/catalina.sh ${WRKSRC}/bin/
|
||||
@(cd ${WRKSRC};${FIND} conf -type f | ${SED} -e '/${CONF_EXT}/d') \
|
||||
| while read a; do \
|
||||
${MV} ${WRKSRC}/$$a ${WRKSRC}/$$a.${CONF_EXT}; \
|
||||
if [ ! -e "${APP_HOME}/$$a" ]; then \
|
||||
${ECHO_MSG} " Installing local configuration file: ${APP_HOME}/$$a"; \
|
||||
${CP} ${WRKSRC}/$$a.${CONF_EXT} ${WRKSRC}/$$a; \
|
||||
else \
|
||||
${ECHO_MSG} " Preserving local configuration file: ${APP_HOME}/$$a"; \
|
||||
fi; \
|
||||
done
|
||||
@${CP} -R ${WRKSRC}/* ${APP_HOME}
|
||||
|
||||
# create missing directories and fix permissions
|
||||
post-install:
|
||||
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
||||
@${ECHO_MSG} "${APP_TITLE} ${PORTVERSION} has been installed in ${APP_HOME}."
|
||||
.include <bsd.port.post.mk>
|
@ -1,2 +0,0 @@
|
||||
SHA256 (apache-tomcat-5.5.36.tar.gz) = 572c57236c28e3066d6ed08e991cb2d3d00740e3b29853bdb841673e0adcbf06
|
||||
SIZE (apache-tomcat-5.5.36.tar.gz) = 9665826
|
@ -1,39 +0,0 @@
|
||||
$FreeBSD$
|
||||
|
||||
--- ./conf/server.xml.orig 2010-09-04 21:54:16.000000000 +0200
|
||||
+++ ./conf/server.xml 2010-10-01 23:00:25.000000000 +0200
|
||||
@@ -27,7 +27,7 @@
|
||||
define subcomponents such as "Valves" or "Loggers" at this level.
|
||||
-->
|
||||
|
||||
-<Server port="8005" shutdown="SHUTDOWN">
|
||||
+<Server port="%%SHUTDOWN_PORT%%" shutdown="SHUTDOWN">
|
||||
|
||||
<!-- Comment these entries out to disable JMX MBeans support used for the
|
||||
administration web application -->
|
||||
@@ -90,11 +90,11 @@
|
||||
IP address of the remote client.
|
||||
-->
|
||||
|
||||
- <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
|
||||
- <Connector port="8080" maxHttpHeaderSize="8192"
|
||||
+ <!-- Define a non-SSL HTTP/1.1 Connector -->
|
||||
+ <Connector port="%%HTTP_PORT%%" maxHttpHeaderSize="8192"
|
||||
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
|
||||
enableLookups="false" redirectPort="8443" acceptCount="100"
|
||||
- connectionTimeout="20000" disableUploadTimeout="true" />
|
||||
+ connectionTimeout="%%HTTP_TIMEOUT%%" disableUploadTimeout="true" />
|
||||
<!-- Note : To disable connection timeouts, set connectionTimeout value
|
||||
to 0 -->
|
||||
|
||||
@@ -115,8 +115,8 @@
|
||||
clientAuth="false" sslProtocol="TLS" />
|
||||
-->
|
||||
|
||||
- <!-- Define an AJP 1.3 Connector on port 8009 -->
|
||||
- <Connector port="8009"
|
||||
+ <!-- Define an AJP 1.3 Connector -->
|
||||
+ <Connector port="%%AJP_1_3_PORT%%"
|
||||
enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
|
||||
|
||||
<!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
|
@ -1,54 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This script does the following.
|
||||
#
|
||||
# * Checks if the PID file exists. If it does, it kills the
|
||||
# process and removes the PID file.
|
||||
#
|
||||
# * Checks if the '%%USER%%' user exists. If it does, then it displays
|
||||
# a message.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PATH=/usr/bin:/bin:/usr/sbin:/usr/local/bin
|
||||
|
||||
USER=%%USER%%
|
||||
GROUP=%%GROUP%%
|
||||
PID_FILE=%%PID_FILE%%
|
||||
|
||||
# Make sure we're in the right stage of the process
|
||||
if [ "$2" = "DEINSTALL" ]; then
|
||||
|
||||
# Kill the process if it is still running
|
||||
if [ -s ${PID_FILE} ]; then
|
||||
PID=`cat ${PID_FILE}`
|
||||
echo -n ">> Killing Tomcat process (${PID})..."
|
||||
kill ${PID} > /dev/null 2> /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
echo " [ DONE ]"
|
||||
else
|
||||
echo " [ FAILED ]"
|
||||
fi
|
||||
echo -n ">> Removing PID file (${PID_FILE})..."
|
||||
rm ${PID_FILE} > /dev/null 2> /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
echo " [ DONE ]"
|
||||
else
|
||||
echo " [ FAILED ]"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$2" = "POST-DEINSTALL" ]; then
|
||||
# If the user/group exists, then display a message
|
||||
if pw usershow "${USER}" 2>/dev/null 1>&2; then
|
||||
echo "To delete the ${USER} user permanently, use 'pw userdel ${USER}'"
|
||||
fi
|
||||
|
||||
if pw groupshow "${GROUP}" 2>&1 >/dev/null; then
|
||||
echo "To delete the ${GROUP} group permanently, use 'pw groupdel ${GROUP}'"
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
@ -1,107 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Checks if the '%%USER%%' user and '%%GROUP%%' group exist. If they don't, then
|
||||
# an attempt is made to create both.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PATH=/usr/bin:/bin:/usr/sbin:/usr/local/bin
|
||||
|
||||
# Set some constants
|
||||
UID=%%UID%%
|
||||
GID=${UID}
|
||||
USER=%%USER%%
|
||||
GROUP=%%GROUP%%
|
||||
APP_HOME=%%APP_HOME%%
|
||||
JAVA_HOME=%%JAVA_HOME%%
|
||||
LOG_DIR=%%LOG_DIR%%
|
||||
STDOUT_LOG=%%STDOUT_LOG%%
|
||||
STDERR_LOG=%%STDERR_LOG%%
|
||||
|
||||
uidgid() {
|
||||
if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
|
||||
|
||||
# If not, try to create it
|
||||
if pw groupadd "${GROUP}" -g ${GID}; then
|
||||
echo "Added group \"${GROUP}\"."
|
||||
elif pw groupadd "${GROUP}"; then
|
||||
echo "Added group \"${GROUP}\"."
|
||||
else
|
||||
echo "Adding group \"${GROUP}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "You already have a group \"${GROUP}\", so I will use it."
|
||||
fi
|
||||
|
||||
# See if the user already exists
|
||||
if ! pw usershow "${USER}" 2>/dev/null 1>&2; then
|
||||
|
||||
# If not, try to create it
|
||||
if pw useradd "${USER}" -u ${UID} -g "${GROUP}" -h - \
|
||||
-s "/usr/sbin/nologin" -d "/nonexistent" \
|
||||
-c "World Wide Web Owner";
|
||||
then
|
||||
echo "Added user \"${USER}\"."
|
||||
elif pw useradd "${USER}" -g "${GROUP}" -h - \
|
||||
-s "/usr/sbin/nologin" -d "/nonexistent" \
|
||||
-c "World Wide Web Owner";
|
||||
then
|
||||
echo "Added user \"${USER}\"."
|
||||
else
|
||||
echo "Adding user \"${USER}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "You already have a user \"${USER}\", so I will use it."
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
post() {
|
||||
echo -n ">> Creating destination directory..."
|
||||
mkdir -p ${APP_HOME}
|
||||
mkdir -p ${LOG_DIR}
|
||||
echo " [ DONE ]"
|
||||
|
||||
echo ">> Copying files to destination directory..."
|
||||
|
||||
echo " [ DONE ]"
|
||||
|
||||
echo -n ">> Creating log files..."
|
||||
install -m 664 -o ${USER} -g ${GROUP} /dev/null ${STDOUT_LOG}
|
||||
install -m 664 -o ${USER} -g ${GROUP} /dev/null ${STDERR_LOG}
|
||||
echo " [ DONE ]"
|
||||
|
||||
echo -n ">> Creating symlink to tools.jar..."
|
||||
ln -sf ${JAVA_HOME}/lib/tools.jar ${APP_HOME}/common/lib/tools.jar
|
||||
echo " [ DONE ]"
|
||||
|
||||
echo -n ">> Fixing ownership settings..."
|
||||
chown -R ${USER}:${GROUP} ${APP_HOME}/conf ${APP_HOME}/logs \
|
||||
${APP_HOME}/temp ${APP_HOME}/work ${APP_HOME}/webapps
|
||||
chmod -R a+r ${APP_HOME}/common ${APP_HOME}/server ${APP_HOME}/bin
|
||||
echo " [ DONE ]"
|
||||
|
||||
echo -n ">> Fixing permissions..."
|
||||
find ${APP_HOME} -type d -exec chmod 755 {} \;
|
||||
echo " [ DONE ] "
|
||||
}
|
||||
|
||||
|
||||
# PACKAGE_BUILDING is only defined on the build cluster or tinderbox!
|
||||
# No interactive parts, there is no one who can answer!
|
||||
if [ "x${PACKAGE_BUILDING}" != "x" ]; then
|
||||
uidgid
|
||||
post
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$2" = "POST-INSTALL" ]; then
|
||||
uidgid
|
||||
post
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exit 0
|
@ -1,184 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
# PROVIDE: tomcat%%TOMCAT_VERSION%%
|
||||
# REQUIRE: NETWORKING SERVERS
|
||||
# BEFORE: DAEMON
|
||||
# KEYWORD: shutdown
|
||||
|
||||
#
|
||||
# Configuration settings for tomcat%%TOMCAT_VERSION%% in /etc/rc.conf:
|
||||
#
|
||||
# tomcat%%TOMCAT_VERSION%%_enable (bool):
|
||||
# Set to "NO" by default.
|
||||
# Set it to "YES" to enable tomcat%%TOMCAT_VERSION%%
|
||||
#
|
||||
# tomcat%%TOMCAT_VERSION%%_flags (str):
|
||||
# Set to "" by default.
|
||||
# Extra flags passed to start command
|
||||
#
|
||||
# tomcat%%TOMCAT_VERSION%%_catalina_home (str)
|
||||
# Set to "%%TOMCAT_HOME%%" by default.
|
||||
# Set the CATALINA_HOME variable for the Tomcat process
|
||||
#
|
||||
# tomcat%%TOMCAT_VERSION%%_catalina_base (str)
|
||||
# Set to "%%TOMCAT_HOME%%" by default.
|
||||
# Set the CATALINA_BASE variable for the Tomcat process
|
||||
#
|
||||
# tomcat%%TOMCAT_VERSION%%_catalina_tmpdir (str)
|
||||
# Set to "%%TOMCAT_HOME%%/temp" by default.
|
||||
# Set the CATALINA_TMPDIR variable for the Tomcat process
|
||||
#
|
||||
# tomcat%%TOMCAT_VERSION%%_stdout_log (str)
|
||||
# Set to "%%STDOUT_LOG%%" by default.
|
||||
# Set the location for the Tomcat process log (standard output)
|
||||
#
|
||||
# tomcat%%TOMCAT_VERSION%%_stderr_log (str)
|
||||
# Set to "%%STDERR_LOG%%" by default.
|
||||
# Set the location for the Tomcat process log (error output)
|
||||
#
|
||||
# tomcat%%TOMCAT_VERSION%%_stop_timeout (num)
|
||||
# Set to "10" by default.
|
||||
# Sets the timeout in seconds to allow tomcat to shutdown.
|
||||
# After the timeout has elapsed, tomcat will be killed.
|
||||
#
|
||||
# tomcat%%TOMCAT_VERSION%%_java_home (str):
|
||||
# tomcat%%TOMCAT_VERSION%%_java_vendor (str):
|
||||
# tomcat%%TOMCAT_VERSION%%_java_version (str):
|
||||
# tomcat%%TOMCAT_VERSION%%_java_os (str):
|
||||
# Specify the requirements of the Java VM to use. See javavm(1).
|
||||
#
|
||||
# tomcat%%TOMCAT_VERSION%%_classpath (str):
|
||||
# Set to "" by default.
|
||||
# Addtional classes to add to the CLASSPATH
|
||||
#
|
||||
# tomcat%%TOMCAT_VERSION%%_java_opts (str):
|
||||
# Set to "" by default.
|
||||
# Java VM args to use.
|
||||
#
|
||||
# tomcat%%TOMCAT_VERSION%%_java_start_opts (str):
|
||||
# Set to "" by default.
|
||||
# Additional Java VM args to use when starting tomcat.
|
||||
#
|
||||
|
||||
tomcat%%TOMCAT_VERSION%%_enable="${tomcat%%TOMCAT_VERSION%%_enable:-"NO"}"
|
||||
tomcat%%TOMCAT_VERSION%%_java_version="${tomcat%%TOMCAT_VERSION%%_java_version:-"%%JAVA_VERSION%%"}"
|
||||
tomcat%%TOMCAT_VERSION%%_user="${tomcat%%TOMCAT_VERSION%%_user:-"%%USER%%"}"
|
||||
tomcat%%TOMCAT_VERSION%%_catalina_home="${tomcat%%TOMCAT_VERSION%%_catalina_home:-"%%TOMCAT_HOME%%"}"
|
||||
tomcat%%TOMCAT_VERSION%%_catalina_base="${tomcat%%TOMCAT_VERSION%%_catalina_base:-"%%TOMCAT_HOME%%"}"
|
||||
tomcat%%TOMCAT_VERSION%%_catalina_tmpdir="${tomcat%%TOMCAT_VERSION%%_catalina_tmpdir:-"%%TOMCAT_HOME%%/temp"}"
|
||||
tomcat%%TOMCAT_VERSION%%_stdout_log="${tomcat%%TOMCAT_VERSION%%_stdout_log:-"%%STDOUT_LOG%%"}"
|
||||
tomcat%%TOMCAT_VERSION%%_stderr_log="${tomcat%%TOMCAT_VERSION%%_stderr_log:-"%%STDERR_LOG%%"}"
|
||||
tomcat%%TOMCAT_VERSION%%_stop_timeout="${tomcat%%TOMCAT_VERSION%%_stop_timeout:-"10"}"
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="tomcat%%TOMCAT_VERSION%%"
|
||||
rcvar=tomcat%%TOMCAT_VERSION%%_enable
|
||||
pidfile="%%PID_FILE%%"
|
||||
|
||||
load_rc_config "${name}"
|
||||
|
||||
if [ -n "${tomcat%%TOMCAT_VERSION%%_java_home}" ] ; then
|
||||
export JAVA_HOME="${tomcat%%TOMCAT_VERSION%%_java_home}"
|
||||
fi
|
||||
|
||||
if [ -n "${tomcat%%TOMCAT_VERSION%%_java_version}" ] ; then
|
||||
export JAVA_VERSION="${tomcat%%TOMCAT_VERSION%%_java_version}"
|
||||
fi
|
||||
|
||||
if [ -n "${tomcat%%TOMCAT_VERSION%%_java_vendor}" ] ; then
|
||||
export JAVA_VENDOR="${tomcat%%TOMCAT_VERSION%%_java_vendor}"
|
||||
fi
|
||||
|
||||
if [ -n "${tomcat%%TOMCAT_VERSION%%_java_os}" ] ; then
|
||||
export JAVA_OS="${tomcat%%TOMCAT_VERSION%%_java_os}"
|
||||
fi
|
||||
|
||||
java_args="-Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS \
|
||||
-classpath %%TOMCAT_HOME%%/%%JAR_FILE%%:%%TOMCAT_HOME%%/bin/commons-logging-api.jar:${tomcat%%TOMCAT_VERSION%%_classpath} \
|
||||
-Dcatalina.base=${tomcat%%TOMCAT_VERSION%%_catalina_base} \
|
||||
-Dcatalina.home=${tomcat%%TOMCAT_VERSION%%_catalina_home} \
|
||||
-Djava.io.tmpdir=${tomcat%%TOMCAT_VERSION%%_catalina_tmpdir} \
|
||||
org.apache.catalina.startup.Bootstrap"
|
||||
|
||||
java_start_command="%%LOCALBASE%%/bin/java \
|
||||
${tomcat%%TOMCAT_VERSION%%_java_opts} \
|
||||
${tomcat%%TOMCAT_VERSION%%_java_start_opts} \
|
||||
${java_args}"
|
||||
|
||||
java_stop_command="%%LOCALBASE%%/bin/java \
|
||||
${tomcat%%TOMCAT_VERSION%%_java_opts} \
|
||||
${java_args}"
|
||||
|
||||
log_args="%%LOG_ARGS%%"
|
||||
|
||||
# Subvert the check_pid_file procname check.
|
||||
if [ -f $pidfile ]; then
|
||||
read rc_pid junk < $pidfile
|
||||
if [ ! -z "$rc_pid" ]; then
|
||||
procname=`ps -o command= -p $rc_pid | cut -f 1 -d ' '`
|
||||
fi
|
||||
fi
|
||||
if [ -z "$procname" ]; then
|
||||
procname=nonexistent
|
||||
fi
|
||||
|
||||
required_files="${tomcat%%TOMCAT_VERSION%%_catalina_home}/conf/server.xml"
|
||||
|
||||
command="/usr/sbin/daemon"
|
||||
flags="-p ${pidfile} ${java_start_command} start ${tomcat%%TOMCAT_VERSION%%_flags} ${log_args}"
|
||||
|
||||
start_precmd=pid_touch
|
||||
stop_cmd="tomcat%%TOMCAT_VERSION%%_stop"
|
||||
status_cmd="tomcat%%TOMCAT_VERSION%%_status"
|
||||
|
||||
pid_touch ()
|
||||
{
|
||||
touch $pidfile
|
||||
chown $tomcat%%TOMCAT_VERSION%%_user $pidfile
|
||||
}
|
||||
|
||||
tomcat%%TOMCAT_VERSION%%_stop() {
|
||||
if [ ! -s "$pidfile" ]; then
|
||||
echo "${name} not running? (check $pidfile)."
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "Stopping ${name}."
|
||||
${java_stop_command} stop
|
||||
tomcat_wait_max_for_pid ${tomcat%%TOMCAT_VERSION%%_stop_timeout} `cat $pidfile`
|
||||
kill -KILL `cat $pidfile` 2> /dev/null && echo "Killed."
|
||||
rm -f ${pidfile}
|
||||
}
|
||||
|
||||
tomcat%%TOMCAT_VERSION%%_status() {
|
||||
if [ ! -s "$pidfile" ]; then
|
||||
echo "${name} is not running."
|
||||
return 1
|
||||
else
|
||||
echo "${name} is running as pid `cat $pidfile`."
|
||||
fi
|
||||
}
|
||||
|
||||
tomcat_wait_max_for_pid() {
|
||||
_timeout=$1
|
||||
shift
|
||||
_pid=$1
|
||||
_prefix=
|
||||
while [ $_timeout -gt 0 ] ; do
|
||||
echo -n ${_prefix:-"Waiting (max $_timeout secs) for PIDS: "}$_pid
|
||||
_prefix=", "
|
||||
sleep 2
|
||||
kill -0 $_pid 2> /dev/null || break
|
||||
_timeout=$(($_timeout-2))
|
||||
done
|
||||
if [ -n "$_prefix" ]; then
|
||||
echo "."
|
||||
fi
|
||||
}
|
||||
|
||||
cd ${tomcat%%TOMCAT_VERSION%%_catalina_base}
|
||||
run_rc_command "$1"
|
@ -1,13 +0,0 @@
|
||||
Apache Tomcat is a web server written in 100% Pure Java.
|
||||
|
||||
Tomcat 5.x is the current release of Tomcat,
|
||||
and builds upon the Tomcat 3.3 and Tomcat 4.1 codebases.
|
||||
The 5.x releases implement the Servlet 2.4 and JSP 2.0 specifications.
|
||||
|
||||
Apache Tomcat 5.5 is the current focus of development.
|
||||
While it supports the same Servlet and JSP Specification versions
|
||||
as Apache Tomcat 5.0.x, there are significant changes in many areas
|
||||
under the hood, resulting in improved performance, stability,
|
||||
and total cost of ownership.
|
||||
|
||||
WWW: http://tomcat.apache.org/
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user