On 12/12/07, Thorsten Scherler
<[EMAIL PROTECTED]> wrote:
> On Tue, 2007-12-11 at 19:28 -0500, [EMAIL PROTECTED] wrote:
> > The goal of my revision to lenya.sh is to make LENYA_HOME independent
> > of an environment variable.  Before this change, running any of these
> > files:
> >    /lenya-1.2.2/lenya.sh
> >    /lenya-1.2.5/lenya.sh
> >    /lenya-1.2.x/lenya.sh
> > will start the same instance of Lenya because the environment variable
> > overrides the path of the command.
>
> Hmm, should not if you have not set LENYA_HOME in your environment
> variables before starting lenya. Otherwise it would not have been
> possible to have two different instance on zone running.

I still cannot analyze how zone works because I do not have access.  I
expect each instance is called from its own directory using something
like:
   cd /lenya1
   lenya.sh servlet
   cd /lenya2
   lenya.sh servlet

> > This is not intuitive.  When I run
> > /lenya-1.2.5/lenya.sh, I expect to launch Lenya 1.2.5, not Lenya
> > 1.2.2.  More critical, running multiple instances of Lenya is not
> > possible when the launch command always reverts to a single instance.
> see above.
>
> We had before
> if [ "$LENYA_HOME" = "" ] ; then
>  LENYA_HOME='.'
> fi

This code works for exactly one case -- lenya.sh must be called from
the Lenya directory.  Startup scripts must change to the Lenya
directory before calling the launch command, and may still have
unexpected results if LENYA_HOME is set as an environment variable.
To test, try to run Lenya from a different directory without setting
LENYA_HOME:
   cd /x1/home/solprovider
   /lenya-1.2.5/lenya.sh servlet
Results:
   INFO: No such war file lenya.war or build directory!
because the build directory and lenya.war file are not found in the
/x1/home/solprovider directory.

> Meaning when you do not set "$LENYA_HOME" it is the same as you intend
> with your commit.

Not setting LENYA_HOME still requires changing the directory before
calling lenya.sh.  I am unaware of another program that requires
changing the directory before calling the launch command.

I am not the only person aware of and working on this issue.  Trunk's
lenya.sh includes:
   if [ "$LENYA_HOME" = "" ] ; then
     LENYA_HOME='.'
     # TODO: Make it startable from any directory
     #LENYA_HOME=`dirname $0`
     #echo "LENYA_HOME: $LENYA_HOME"
   fi

Who tried using "dirname"?  That code cannot fix the issue because
LENYA_HOME is not set to the absolute path.  Can we use this code?

   cd `dirname $0`
   LENYA_HOME=`pwd -P`

Is the dirname program more generically available than the percent
sign syntax for string manipulation?

For the record, the rest of my original commit added a "stop" command
line option and automatically shut down the Lenya instance from this
directory before launching a new instance.  Lenya 2.0 should benefit
from that code.

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to