ports/158237: [patch][maintainer-update] www/tomcat55: fix cronolog processing option
Jason Helfman
jhelfman at e-e.com
Fri Jun 24 00:50:10 UTC 2011
The following reply was made to PR ports/158237; it has been noted by GNATS.
From: Jason Helfman <jhelfman at e-e.com>
To: bug-followup at freebsd.org
Cc:
Subject: Re: ports/158237: [patch][maintainer-update] www/tomcat55: fix
cronolog processing option
Date: Thu, 23 Jun 2011 17:41:17 -0700
In working with a new application we have in-house, we found that tomcat was
starting it's java command from /, and felt this was not correct and that
tomcat should be starting from the catalina_base directory. The following
patch addresses this issue, and includes the previous patch supplied in this
ticket.
In any event, using catalina_base as a startup location is better than /.
This was added to the startup file for tomcat55.
Thanks! Jason
Index: tomcat55/files/logprocessor-cronolog
===================================================================
RCS file: tomcat55/files/logprocessor-cronolog
diff -N tomcat55/files/logprocessor-cronolog
--- tomcat55/files/logprocessor-cronolog 12 Dec 2010 18:46:12 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,74 +0,0 @@
---- bin/catalina.sh.orig 2010-09-04 12:53:47.000000000 -0700
-+++ bin/catalina.sh 2010-12-08 16:10:30.000000000 -0800
-@@ -245,7 +245,9 @@
- -Dcatalina.base="$CATALINA_BASE" \
- -Dcatalina.home="$CATALINA_HOME" \
- -Djava.io.tmpdir="$CATALINA_TMPDIR" \
-- org.apache.catalina.startup.Bootstrap "$@" start
-+ org.apache.catalina.startup.Bootstrap "$@" start %%REDIRECT%% \
-+ | "%%LOG_PROCESSOR%%" "%%LOG_PROCESSOR_OPTS%%" "%%LOG_PROCESSOR_DIRECTIVES%%" &
-+
- else
- exec "$_RUNJDB" "$LOGGING_CONFIG" $JAVA_OPTS $CATALINA_OPTS \
- -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
-@@ -253,7 +255,8 @@
- -Dcatalina.base="$CATALINA_BASE" \
- -Dcatalina.home="$CATALINA_HOME" \
- -Djava.io.tmpdir="$CATALINA_TMPDIR" \
-- org.apache.catalina.startup.Bootstrap "$@" start
-+ org.apache.catalina.startup.Bootstrap "$@" start %%REDIRECT%% \
-+ | "%%LOG_PROCESSOR%%" "%%LOG_PROCESSOR_OPTS%%" "%%LOG_PROCESSOR_DIRECTIVES%%" &
- fi
- fi
-
-@@ -272,14 +275,16 @@
- -Dcatalina.base="$CATALINA_BASE" \
- -Dcatalina.home="$CATALINA_HOME" \
- -Djava.io.tmpdir="$CATALINA_TMPDIR" \
-- org.apache.catalina.startup.Bootstrap "$@" start
-+ org.apache.catalina.startup.Bootstrap "$@" start %%REDIRECT%% \
-+ | "%%LOG_PROCESSOR%%" "%%LOG_PROCESSOR_OPTS%%" "%%LOG_PROCESSOR_DIRECTIVES%%" &
- else
- exec "$_RUNJAVA" "$LOGGING_CONFIG" $JAVA_OPTS $CATALINA_OPTS \
- -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
- -Dcatalina.base="$CATALINA_BASE" \
- -Dcatalina.home="$CATALINA_HOME" \
- -Djava.io.tmpdir="$CATALINA_TMPDIR" \
-- org.apache.catalina.startup.Bootstrap "$@" start
-+ org.apache.catalina.startup.Bootstrap "$@" start %%REDIRECT%% \
-+ | "%%LOG_PROCESSOR%%" "%%LOG_PROCESSOR_OPTS%%" "%%LOG_PROCESSOR_DIRECTIVES%%" &
- fi
-
- elif [ "$1" = "start" ] ; then
-@@ -298,8 +303,8 @@
- -Dcatalina.base="$CATALINA_BASE" \
- -Dcatalina.home="$CATALINA_HOME" \
- -Djava.io.tmpdir="$CATALINA_TMPDIR" \
-- org.apache.catalina.startup.Bootstrap "$@" start \
-- >> "$CATALINA_OUT" 2>&1 &
-+ org.apache.catalina.startup.Bootstrap "$@" start %%REDIRECT%% \
-+ | "%%LOG_PROCESSOR%%" "%%LOG_PROCESSOR_OPTS%%" "%%LOG_PROCESSOR_DIRECTIVES%%" &
-
- if [ ! -z "$CATALINA_PID" ]; then
- echo $! > $CATALINA_PID
-@@ -310,8 +315,8 @@
- -Dcatalina.base="$CATALINA_BASE" \
- -Dcatalina.home="$CATALINA_HOME" \
- -Djava.io.tmpdir="$CATALINA_TMPDIR" \
-- org.apache.catalina.startup.Bootstrap "$@" start \
-- >> "$CATALINA_OUT" 2>&1 &
-+ org.apache.catalina.startup.Bootstrap "$@" start %%REDIRECT%% \
-+ | "%%LOG_PROCESSOR%%" "%%LOG_PROCESSOR_OPTS%%" "%%LOG_PROCESSOR_DIRECTIVES%%" &
-
- if [ ! -z "$CATALINA_PID" ]; then
- echo $! > $CATALINA_PID
-@@ -332,7 +337,8 @@
- -Dcatalina.base="$CATALINA_BASE" \
- -Dcatalina.home="$CATALINA_HOME" \
- -Djava.io.tmpdir="$CATALINA_TMPDIR" \
-- org.apache.catalina.startup.Bootstrap "$@" stop
-+ org.apache.catalina.startup.Bootstrap "$@" stop %%REDIRECT%% \
-+ | "%%LOG_PROCESSOR%%" "%%LOG_PROCESSOR_OPTS%%" "%%LOG_PROCESSOR_DIRECTIVES%%" &
-
- if [ $FORCE -eq 1 ]; then
- if [ ! -z "$CATALINA_PID" ]; then
Index: tomcat55/files/tomcat55.sh.in
===================================================================
RCS file: /home/jhelfman/ncvs/ports/www/tomcat55/files/tomcat55.sh.in,v
retrieving revision 1.10
diff -u -r1.10 tomcat55.sh.in
--- tomcat55/files/tomcat55.sh.in 7 Oct 2010 21:17:37 -0000 1.10
+++ tomcat55/files/tomcat55.sh.in 24 Jun 2011 00:33:58 -0000
@@ -102,8 +102,7 @@
-Djava.io.tmpdir=${tomcat%%TOMCAT_VERSION%%_catalina_tmpdir} \
org.apache.catalina.startup.Bootstrap"
-log_args=">> ${tomcat%%TOMCAT_VERSION%%_stdout_log} \
- 2>> ${tomcat%%TOMCAT_VERSION%%_stderr_log} "
+log_args="%%LOG_ARGS%%"
# Subvert the check_pid_file procname check.
if [ -f $pidfile ]; then
@@ -181,4 +180,5 @@
fi
}
+cd ${tomcat%%TOMCAT_VERSION%%_catalina_base}
run_rc_command "$1"
Index: tomcat55/Makefile
===================================================================
RCS file: /home/jhelfman/ncvs/ports/www/tomcat55/Makefile,v
retrieving revision 1.58
diff -u -r1.58 Makefile
--- tomcat55/Makefile 15 Feb 2011 07:22:27 -0000 1.58
+++ tomcat55/Makefile 23 Jun 2011 20:56:05 -0000
@@ -7,6 +7,7 @@
PORTNAME= tomcat
PORTVERSION= 5.5.33
+PORTREVISION= 1
CATEGORIES= www java
MASTER_SITES= ${MASTER_SITE_APACHE}
MASTER_SITE_SUBDIR= tomcat/tomcat-5/v${PORTVERSION}/bin
@@ -61,6 +62,7 @@
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} \
@@ -89,15 +91,10 @@
RUN_DEPENDS+= cronolog:${PORTSDIR}/sysutils/cronolog-devel
.endif
-.if ( defined(WITH_CRONOLOG) || (WITH_CRONOLOG_DEVEL) )
-LOG_PROCESSOR?= ${LOCALBASE}/sbin/cronolog
-LOG_PROCESSOR_DIRECTIVES?= "\$$CATALINA_OUT \$$CATALINA_BASE/logs/catalina.out.\%Y_\%m_\%d.out"
-LOG_PROCESSOR_OPTS?= --link
-REDIRECT?= "2\>\&1"
-SUB_LIST+= LOG_PROCESSOR=${LOG_PROCESSOR} \
- LOG_PROCESSOR_DIRECTIVES=${LOG_PROCESSOR_DIRECTIVES} \
- LOG_PROCESSOR_OPTS=${LOG_PROCESSOR_OPTS} \
- REDIRECT=${REDIRECT}
+.if !( defined(WITH_CRONOLOG) || (WITH_CRONOLOG_DEVEL) )
+LOG_ARGS?=">> \$${tomcat\%\%TOMCAT_VERSION\%\%_stdout_log} 2>> \$${tomcat\%\%TOMCAT_VERSION\%\%_stderr_log}"
+.else
+LOG_ARGS?="2>\&1 | ${LOCALBASE}/sbin/cronolog --link \$${tomcat55_catalina_base}/logs/catalina.out \$${tomcat55_catalina_base}/logs/catalina.\%Y_\%m_\%d.out \&"
.endif
.if ( defined(WITH_CRONOLOG) && defined(WITH_CRONOLOG_DEVEL) )
@@ -116,11 +113,6 @@
@${ECHO_MSG} " Logfile stdout: ${STDOUT_LOG}"
@${ECHO_MSG} " Logfile stderr: ${STDERR_LOG}"
-post-patch:
-.if ( defined(WITH_CRONOLOG) || (WITH_CRONOLOG_DEVEL) )
- @cd ${WRKSRC} && ${PATCH} --quiet < ${FILESDIR}/logprocessor-cronolog
-.endif
-
@${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
More information about the freebsd-ports-bugs
mailing list