From nobody@FreeBSD.org  Thu Sep  8 20:47:46 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AEA661065672
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  8 Sep 2011 20:47:46 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 94CAA8FC17
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  8 Sep 2011 20:47:46 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p88Klkd4038688
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 8 Sep 2011 20:47:46 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p88Klkkb038687;
	Thu, 8 Sep 2011 20:47:46 GMT
	(envelope-from nobody)
Message-Id: <201109082047.p88Klkkb038687@red.freebsd.org>
Date: Thu, 8 Sep 2011 20:47:46 GMT
From: Phil Phillips <pphillips@experts-exchange.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] www/tomcat55: allow for separate java start arguments in rc script
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: jhelfman@experts-exchange.com

>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:    crees
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 08 20:50:04 UTC 2011
>Closed-Date:    Sun Sep 11 12:05:52 UTC 2011
>Last-Modified:  Sun Sep 11 12:10:05 UTC 2011
>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@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:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Thu Sep 8 20:50:14 UTC 2011 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=160571 

From: Edwin Groothuis <edwin@FreeBSD.org>
To: jhelfman@experts-exchange.com
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/160571: [PATCH] www/tomcat55: allow for separate java start arguments in rc script
Date: Thu, 8 Sep 2011 20:50:12 UT

 Maintainer of www/tomcat55,
 
 Please note that PR ports/160571 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/160571
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org

From: Phil Phillips <pphillips@experts-exchange.com>
To: bug-followup@FreeBSD.org, pphillips@experts-exchange.com
Cc:  
Subject: Re: ports/160571: [PATCH] www/tomcat55: allow for separate java start
 arguments in rc script
Date: Thu, 08 Sep 2011 14:17:36 -0700

 This is a multi-part message in MIME format.
 --------------000505050007090204080804
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Updating patch to include %%TOMCAT_VERSION%% where needed.
 
 --------------000505050007090204080804
 Content-Type: text/plain;
  name="tomcat55.patch.txt"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="tomcat55.patch.txt"
 
 --- 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 \
 +	${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.
 @@ -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}
 
 --------------000505050007090204080804--

From: Jason Helfman <jhelfman@e-e.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/160571: [PATCH] www/tomcat55: allow for separate java
 start arguments in rc script
Date: Thu, 8 Sep 2011 16:17:15 -0700

 Looks good to me.
 
 -jgh
 
 -- 
 Jason Helfman
 System Administrator
 experts-exchange.com
 http://www.experts-exchange.com/M_4830110.html
 E4AD 7CF1 1396 27F6 79DD  4342 5E92 AD66 8C8C FBA5
Responsible-Changed-From-To: freebsd-ports-bugs->crees 
Responsible-Changed-By: crees 
Responsible-Changed-When: Sat Sep 10 08:58:54 UTC 2011 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=160571 
State-Changed-From-To: feedback->closed 
State-Changed-By: crees 
State-Changed-When: Sun Sep 11 12:05:50 UTC 2011 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=160571 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/160571: commit references a PR
Date: Sun, 11 Sep 2011 12:04:33 +0000 (UTC)

 crees       2011-09-11 12:04:20 UTC
 
   FreeBSD ports repository
 
   Modified files:
     www/tomcat55         Makefile 
     www/tomcat55/files   tomcat55.sh.in 
   Added files:
     www/tomcat55/files   patch-conf-server.xml 
   Removed files:
     www/tomcat55/files   patch-conf::server.xml 
   Log:
   - Allow user to add flags for startup case only
   - (while here, stop using '::' in patchfile names)
   
   PR:             ports/160571
   Submitted by:   Phil Phillips <pphillips@experts-exchange.com>
   Approved by:    Jason Helfman <jhelfman@e-e.com> (maintainer)
   
   Revision  Changes    Path
   1.63      +1 -1      ports/www/tomcat55/Makefile
   1.1       +39 -0     ports/www/tomcat55/files/patch-conf-server.xml (new)
   1.6       +0 -37     ports/www/tomcat55/files/patch-conf::server.xml (dead)
   1.12      +17 -6     ports/www/tomcat55/files/tomcat55.sh.in
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
