Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 64399 invoked from network); 1 Dec 2008 21:54:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Dec 2008 21:54:16 -0000 Received: (qmail 45179 invoked by uid 500); 1 Dec 2008 21:54:26 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 45140 invoked by uid 500); 1 Dec 2008 21:54:26 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 45129 invoked by uid 99); 1 Dec 2008 21:54:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Dec 2008 13:54:26 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Dec 2008 21:52:57 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4C7DB234C29F for ; Mon, 1 Dec 2008 13:53:44 -0800 (PST) Message-ID: <688683246.1228168424312.JavaMail.jira@brutus> Date: Mon, 1 Dec 2008 13:53:44 -0800 (PST) From: "Jarek Gawor (JIRA)" To: dev@geronimo.apache.org Subject: [jira] Commented: (GERONIMO-4229) clarify use of GERONIMO_HOME vs. GERONIMO_BASE in shell scripts In-Reply-To: <1781612315.1218052364603.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/GERONIMO-4229?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1= 2652171#action_12652171 ]=20 Jarek Gawor commented on GERONIMO-4229: --------------------------------------- I looked at this a bit and this is pretty screwed up. First, the "org.apach= e.geronimo.base.dir" is not used anywhere in Geronimo code (can't find any = references to it). I think the scripts should be passing "-Dorg.apache.gero= nimo.home.dir=3D$GERONIMO_HOME" instead. Second, the $GERONIMO_BASE propert= y corresponds to "org.apache.geronimo.server.dir" property in code. But we = cannot automatically set and pass this property in the scripts as the "org.= apache.geronimo.server.name" property will be totally ignored. That is, wha= t is documented right now in how to setup and run multiple servers will not= work anymore. So, we will need to fix the code or scripts somehow. Maybe t= he easiest thing right now is to get rid off the GERONIMO_BASE property in = scripts (it doesn't do anything right now anyway since the "org.apache.gero= nimo.base.dir" is not referenced in the code anywhere). In that case, the u= ser either would need to pass the "org.apache.geronimo.server.dir" or "org.= apache.geronimo.server.name" property via GERONIMO_OPTS env. property. > clarify use of GERONIMO_HOME vs. GERONIMO_BASE in shell scripts > --------------------------------------------------------------- > > Key: GERONIMO-4229 > URL: https://issues.apache.org/jira/browse/GERONIMO-4229 > Project: Geronimo > Issue Type: Bug > Security Level: public(Regular issues)=20 > Components: startup/shutdown > Affects Versions: 2.1.1 > Environment: ALL > Reporter: Russell E Glaue > Priority: Minor > Attachments: geronimo-shell-home-base-2.patch > > > I was not seeing consistent usage in the shell scripts of the following: > - GERONIMO_HOME > - GERONIMO_BASE > - org.apache.geronimo.base.dir > In 4 of the scripts, GERONIMO_BASE was used where GERONIMO_HOME should ha= ve been used, or GERONIMO_BASE should be used to complete the path to the t= emp file, otherwise the GeronimoInstallationPath is used to complete the te= mp file path. > The attached patch corrects these. > For more information, please see my thread on user@geronimo.apache.org > Subject: GERONIMO_BASE vs. GERONIMO_HOME and org.apache.geronimo.base.dir > And as an additional note, this patch resolves a few errors, but not thes= e two: > (1)- > Using GERONIMO_BASE: /usr/local/geronimo/server1 > Using GERONIMO_HOME: /usr/local/geronimo > Using GERONIMO_TMPDIR: var/temp > Using JRE_HOME: /usr/jdk1.5.0_07/jre > 10:45:33,914 ERROR [LocalAttributeManager] Caught exception java.io.FileN= otFoundException: /usr/local/geronimo-jetty6-javaee5-2.1.1/var/config/confi= g-substitutions.properties (No such file or directory) trying to open prope= rties file /usr/local/geronimo-jetty6-javaee5-2.1.1/var/config/config-subst= itutions.properties > - > Geronimo looks for the 'var/config/config-substitutions.properties' file = according to 'org.apache.geronimo.server.dir' variable. > However the bin/geronimo.sh script only sets -Dorg.apache.geronimo.base.d= ir=3D$GERONIMO_BASE > But I do not see how org.apache.geronimo.base.dir is used inside Geronimo= . > To fix we would have to set the variable -Dorg.apache.geronimo.server.dir= =3D$GERONIMO_BASE too - but we cannot do that if we want users to be able t= o supply the -Dorg.apache.geronimo.server.name=3D variable o= utside of bin/geronimo.sh in $GERONIMO_OPTS env var. > - > So I could not figure out a good way to address this error, unless we ove= rrided org.apache.geronimo.base.dir variable with whatever is in the org.ap= ache.geronimo.server.dir variable, then change Geronimo to look for the con= figSubstitutionFile as '/var/config/config-su= bstitutions.properties' > And it appears that Geronimo ignores org.apache.geronimo.base.dir in favo= r of org.apache.geronimo.home.dir anyway, so removing the configured org.ap= ache.geronimo.base.dir property in bin/geronimo.sh does not seem to hurt an= ything - at first test, at least, it works for me. > Then we just always set org.apache.geronimo.base.dir =3D org.apache.geron= imo.server.dir > - > I would appreciate if someone shed light on the proper intended usage of = the org.apache.geronimo.base.dir property. > - > (2)- > Using GERONIMO_BASE: /usr/local/geronimo/server1 > Using GERONIMO_HOME: /usr/local/geronimo > Using GERONIMO_TMPDIR: var/temp > Using JRE_HOME: /usr/jdk1.5.0_07/jre > ... > The java.io.tmpdir system property specifies a non-existent directory: /u= sr/local/geronimo-jetty6-javaee5-2.1.2/var/temp > - > read: /usr/local/geronimo/bin/geronimo.sh > # GERONIMO_TMPDIR (Optional) Directory path location of temporary direc= tory > # the JVM should use (java.io.tmpdir). > # Defaults to $GERONIMO_BASE/var/temp. > if [ -z "$GERONIMO_TMPDIR" ] ; then > # Define the java.io.tmpdir to use for Geronimo > # A relative value will be resolved relative to each instance > GERONIMO_TMPDIR=3Dvar/temp > fi > - > This is incorrect documentation, as the error message illustrates. > GERONIMO_TMPDIR does not default to $GERONIMO_BASE/var/temp > Nor does it default to $GERONIMO_HOME/var/temp > Instead: It defaults to /var/temp > Or also org.apache.geronimo.server.dir/var/temp > GERONIMO_TMPDIR should be set with $GERONIMO_BASE/var/temp > Or also org.apache.geronimo.base.dir/var/temp to comply with the document= ation > - > Setting GERONIMO_TMPDIR=3D"$GERONIMO_BASE"/var/temp in bin/geronimo.sh wi= ll actually conflict with anyone using the -Dorg.apache.geronimo.server.nam= e=3D to run multiple instances as documented in the geronimo= wiki. > The absolute path is resolved to / IF is a relative path. > So setting the absolute path in bin/geronimo.sh would require the user to= additionally specify the absolute path of $GERONIMO_TMPDIR into their gero= nimo instance. > The change, causing the property org.apache.geronimo.base.dir to be used,= would have to be completed internally in the java classes that set the pro= perties. > - > How To Produce The Errors the attached patch fixes: > > 1) expand geronimo-jetty6-javaee5-2.1.2 in /usr/local/ > 2) cd /usr/local; ln -s geronimo-jetty6-javaee5-2.1.2 geronimo > 2) create the directory /usr/local/geronimo/server1 > 3) move /usr/local/geronimo/var to /usr/local/geronimo/server1/var > 4) start geronimo with this shell command: > - > cd /usr/local/geronimo > export GERONIMO_HOME=3D/usr/local/geronimo > export GERONIMO_BASE=3D/usr/local/geronimo/server1 > exec ${GERONIMO_HOME}/bin/startup.sh > - > > > $ cat /usr/local/geronimo/server1/var/log/geronimo.out | grep '\[java.*.d= irs\]' > /usr/jdk1.5.0_07/jre/lib/i386/client:/usr/jdk1.5.0_07/jre/lib/i386:/usr/j= dk1.5.0_07/jre/../lib/i386 > 10:45:33,955 INFO [Log4jService] System property [java.endorsed.dirs] = =3D /usr/local/geronimo/server1/lib/endorsed:/usr/jdk1.5.0_07/jre/lib/endo= rsed > 10:45:33,955 INFO [Log4jService] System property [java.ext.dirs] = =3D /usr/local/geronimo/server1/lib/ext:/usr/jdk1.5.0_07/jre/lib/ext > - > read: /usr/local/geronimo/bin/geronimo.sh > # For Cygwin, switch paths to Windows format before running java > if $cygwin; then > ... > EXT_DIRS=3D"$GERONIMO_BASE/lib/ext;$JRE_HOME/lib/ext" > ENDORSED_DIRS=3D"$GERONIMO_BASE/lib/endorsed;$JRE_HOME/lib/endorsed" > else > EXT_DIRS=3D"$GERONIMO_BASE/lib/ext:$JRE_HOME/lib/ext" > ENDORSED_DIRS=3D"$GERONIMO_BASE/lib/endorsed:$JRE_HOME/lib/endorsed" > fi > ... > # Setup the Java programming language agent > JAVA_AGENT_JAR=3D"$GERONIMO_BASE/bin/jpa.jar" > - > There is no such directory as '/usr/local/geronimo/server1/lib/' > but the bin/geronimo.sh script uses GERONIMO_BASE to point at the lib dir= ectory. > That should be $GERONIMO_HOME > The same for JAVA_AGENT_JAR which points at /usr/local/geronimo/server1/b= in/jpa.jar in this example > GERONIMO_HOME is used only for the scope of the shell scripts, and everyt= hing else uses it only for starting Geronimo, so we should be consistent. > - > =20 --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.