From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Nov 16 15:30:00 2012 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 92BDC1A8 for ; Fri, 16 Nov 2012 15:30:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 69A288FC0C for ; Fri, 16 Nov 2012 15:30:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id qAGFU0kx019061 for ; Fri, 16 Nov 2012 15:30:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id qAGFU0OY019060; Fri, 16 Nov 2012 15:30:00 GMT (envelope-from gnats) Resent-Date: Fri, 16 Nov 2012 15:30:00 GMT Resent-Message-Id: <201211161530.qAGFU0OY019060@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Victor Balada Diaz Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 777E2175; Fri, 16 Nov 2012 15:26:22 +0000 (UTC) (envelope-from victor@equilibrium.bsdes.net) Received: from equilibrium.bsdes.net (244.Red-217-126-240.staticIP.rima-tde.net [217.126.240.244]) by mx1.freebsd.org (Postfix) with ESMTP id 152538FC13; Fri, 16 Nov 2012 15:26:22 +0000 (UTC) Received: by equilibrium.bsdes.net (Postfix, from userid 1001) id 244CE39832; Fri, 16 Nov 2012 16:26:21 +0100 (CET) Message-Id: <20121116152621.244CE39832@equilibrium.bsdes.net> Date: Fri, 16 Nov 2012 16:26:21 +0100 (CET) From: Victor Balada Diaz To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/173662: [Ports: www/tomcat7]: Add missing features to init script Cc: ale@FreeBSD.org X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Victor Balada Diaz List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2012 15:30:00 -0000 >Number: 173662 >Category: ports >Synopsis: [Ports: www/tomcat7]: Add missing features to init 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: Fri Nov 16 15:30:00 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Victor Balada Diaz >Release: FreeBSD 7.4-RELEASE-p3 i386 >Organization: >Environment: >Description: www/tomcat6 init script does have the following variables that are missing on www/tomcat7: tomcat7_java_vendor (str): tomcat7_java_version (str): tomcat7_java_os (str): These are very useful if you have more than one JVM installed to select which want to use. As they existed on tomcat6 port, i was expecting to find them on tomcat7. >How-To-Repeat: >Fix: The following patch adds them. The reason to run java in dry mode is that unless you specify JAVA_HOME jsvc doesn't work. The easiest way that i've found to get a proper JAVA_HOME from other settings is just running on dry mode and let javavm tell me what's the proper JAVA_HOME. Probably there's a better way to do this, but i think this is good enough. This work is based on www/tomcat6 init script. --- tomcat7.patch begins here --- Index: files/tomcat7.in =================================================================== --- files/tomcat7.in (revision 307487) +++ files/tomcat7.in (working copy) @@ -43,8 +43,10 @@ # Set the JUL config file # # tomcat7_java_home (str): -# Set to "%%JAVA_HOME%%" by default. -# Specify the Java VM to use. +# tomcat7_java_vendor (str): +# tomcat7_java_version (str): +# tomcat7_java_os (str): +# Specify the requirements of the Java VM to use. See javavm(1). # # tomcat7_classpath (str): # Set to "" by default. @@ -80,8 +82,32 @@ load_rc_config "${name}" +if [ -n "${tomcat7_java_version}" ] ; then + export JAVA_VERSION="${tomcat7_java_version}" +fi + +if [ -n "${tomcat7_java_vendor}" ] ; then + export JAVA_VENDOR="${tomcat7_java_vendor}" +fi + +if [ -n "${tomcat7_java_os}" ] ; then + export JAVA_OS="${tomcat7_java_os}" +fi + +if [ -n "${tomcat7_java_home}" ] ; then + export JAVA_HOME="${tomcat7_java_home}" +else + # Create a sane environment + export JAVAVM_DRYRUN=1 + OUTPUT=$(java) + for i in $OUTPUT + do + export $i + done + unset JAVAVM_DRYRUN +fi + eval "${rcvar}=\${${rcvar}:-'NO'}" -eval "_tomcat_java_home=\${${name}_java_home:-'%%JAVA_HOME%%'}" eval "_tomcat_catalina_user=\${${name}_catalina_user:-'%%TOMCAT_USER%%'}" eval "_tomcat_catalina_home='%%TOMCAT_HOME%%'" eval "_tomcat_catalina_base=\${${name}_catalina_base:-'%%TOMCAT_HOME%%'}" @@ -103,8 +129,7 @@ extra_commands="reload" command="%%LOCALBASE%%/bin/jsvc" -command_args="-java-home '${_tomcat_java_home}' \ - -server \ +command_args="-server \ -user ${_tomcat_catalina_user} \ -pidfile '${pidfile}' \ -wait ${_tomcat_wait} \ --- tomcat7.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: