ports/160571: [PATCH] www/tomcat55: allow for separate java start arguments in rc script

Phil Phillips pphillips at experts-exchange.com
Thu Sep 8 20:50:05 UTC 2011


>Number:         160571
>Category:       ports
>Synopsis:       [PATCH] www/tomcat55: allow for separate java start arguments in rc script
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 08 20:50:04 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Phil Phillips
>Release:        8.2-RELEASE
>Organization:
Experts Exchange, LLC
>Environment:
FreeBSD ip3.experts-exchange.com 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 17 02:41:51 UTC 2011     root at mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
The stop and start routines in the tomcat55 rc script pass the same java arguments no matter what.

There are a few cases where someone might want to start tomcat with different java arguments (i.e. enable Java debugging/JDWP).

Here's a patch that will allow users to specify additional java arguments for tomcat startup only.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- Makefile.orig	2011-08-10 17:06:33.000000000 -0700
+++ Makefile	2011-09-08 13:31:24.000000000 -0700
@@ -7,7 +7,7 @@
 
 PORTNAME=	tomcat
 PORTVERSION=	5.5.33
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	www java
 MASTER_SITES=	${MASTER_SITE_APACHE}
 MASTER_SITE_SUBDIR=	tomcat/tomcat-5/v${PORTVERSION}/bin
--- files/tomcat55.sh.in.orig	2011-07-19 15:45:27.000000000 -0700
+++ files/tomcat55.sh.in	2011-09-08 13:31:00.000000000 -0700
@@ -58,6 +58,10 @@
 #   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%%"}"
@@ -93,15 +97,22 @@
 	export JAVA_OS="${tomcat%%TOMCAT_VERSION%%_java_os}"
 fi
 
-java_command="%%LOCALBASE%%/bin/java \
-	${tomcat%%TOMCAT_VERSION%%_java_opts} \
-	-Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS \
+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 \
+	${tomcat55_java_opts} \
+	${tomcat55_java_start_opts} \
+	${java_args}"
+
+java_stop_command="%%LOCALBASE%%/bin/java \
+	${tomcat55_java_opts} \
+	${java_args}"
+
 log_args="%%LOG_ARGS%%"
 
 # Subvert the check_pid_file procname check.
@@ -118,7 +129,7 @@
 required_files="${tomcat%%TOMCAT_VERSION%%_catalina_home}/conf/server.xml"
 
 command="/usr/sbin/daemon"
-flags="-p ${pidfile} ${java_command} start ${tomcat%%TOMCAT_VERSION%%_flags} ${log_args}"
+flags="-p ${pidfile} ${java_start_command} start ${tomcat%%TOMCAT_VERSION%%_flags} ${log_args}"
 
 start_precmd=pid_touch
 stop_cmd="tomcat%%TOMCAT_VERSION%%_stop"
@@ -137,7 +148,7 @@
 	fi
 	
 	echo "Stopping ${name}."
-	${java_command} stop
+	${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}


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list