You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by "Kimsey-Hickman, Brian" <Br...@occompt.com> on 2008/06/24 15:22:05 UTC

Startup Script for Lenya

Has anybody come up with a startup script for Lenya on standalone so it
can be run as a daemon in Linux?  Something that could be used or
adapted to be used in Red Hat?  I don't seem to be able to find
anything.

Thanks,

Brian

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Startup Script for Lenya

Posted by Jann Forrer <ja...@id.uzh.ch>.
Markus Angst wrote:
>> Has anybody come up with a startup script for Lenya on standalone so it
>> can be run as a daemon in Linux?  Something that could be used or
>> adapted to be used in Red Hat?  I don't seem to be able to find
>> anything.
> 
> Do you know http://wrapper.tanukisoftware.org ? It works well for us so far. We
> use it under Windows; maybe for Linux simpler solutions exist, I don't know.
> 

You might look at:

http://tomcat.apache.org/tomcat-5.5-doc/setup.html

There they describe how Tomcat can be run as a daemon using the jsvc
tool from the daemons project:

http://commons.apache.org/daemon/jsvc.html

It tried it some times ago but i don't know what the current status is.

Jann


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Startup Script for Lenya

Posted by Markus Angst <ma...@inventec.ch>.
> Has anybody come up with a startup script for Lenya on standalone so it
> can be run as a daemon in Linux?  Something that could be used or
> adapted to be used in Red Hat?  I don't seem to be able to find
> anything.

Do you know http://wrapper.tanukisoftware.org ? It works well for us so far. We
use it under Windows; maybe for Linux simpler solutions exist, I don't know.

Regards,
Markus Angst

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Startup Script for Lenya

Posted by so...@apache.org.
Hi Brian,

The error message comes from a check in lenya.sh that JAVA_HOME is not
the empty string.  From your information, that message should not
appear.  You could add your echo test to lenya.sh.

Lenya-1.2.5 was released on 2007-02-28 before my changes to lenya.sh
were committed.

lenya.sh running on my production RedHat server is attached.  The
changes allow running multiple copies of Lenya from different
directories.
- Lenya loads from the current directory rather than the global
LENYA_HOME (otherwise Lenya loaded from the LENYA_HOME directory
regardless of which lenya.sh was called.)
- JETTY_PORT is specified in lenya.sh (so different copies can be run
simultaneously without port conflicts.)
- Added the "stop" command.
- If Lenya is already running from this directory, this instance of
Lenya will stop before starting again.

A slightly modified version was committed on 2007-12-07:
   http://svn.apache.org/viewvc/lenya/branches/BRANCH_1_2_X/lenya.sh?view=markup
The only difference between my production version and the 1.2.X branch
is we changed the directory resolution to use "dirname" because the
1978 version of sh could not handle parsing with "expr".  The
committed code is better -- more concise and works on every flavor of
*nix.  (I did not "fix" my working production server with this
change.)

These changes have not been ported to trunk (Lenya-2.X) yet.

None of this affects JAVA_HOME -- the test is the same in 1.2.5,
1.2.X, and trunk.

Summarizing your problem:
- JAVA_HOME is set correctly in the init script. This should be a global change.
- JAVA_HOME is set correctly when running lenya.sh as the lenya user
after all init processes complete.
- JAVA_HOME is not set correctly when using sudo to run Lenya from the
init script.
- The only difference is the released version of lenya.sh would run
Lenya from the LENYA_HOME directory rather than the current directory.
 This only matters if LENYA_HOME is not set to the current Lenya
directory and should not matter as the JAVA_HOME test precedes any use
of LENYA_HOME.

Next Steps:
- Upgrade lenya.sh.  The committed version is best.  (Or just checkout 1.2.X.)
- Check if anything else is setting JAVA_HOME.  (This does not make
sense.  Even if you export JAVA_HOME somewhere else, you are unlikely
to set it to the empty string.)

Wishing for a better answer,
solprovider


On 6/30/08, Kimsey-Hickman, Brian <Br...@occompt.com> wrote:
> Solprovider, thanks for the help.
>  I checked for that line in the export list and I do have a line:
>  Declare -x JAVA_HOME="/usr/local/src/j2sdk1.4.2._17"
>
>  When I su to user lenya (the username I am running in lenya125).
>  However. I am still getting that JAVA_HOME error when I run the lenya125
>  script.
>  I do have the sdk version of JAVA installed (j2sdk1.4.2_17) and lenya
>  works when I run ./lenya.sh from the command line as user lenya.
>
>  I must be overlooking something but I can't figure out what.
>  Brian

RE: Startup Script for Lenya

Posted by "Kimsey-Hickman, Brian" <Br...@occompt.com>.
Solprovider, thanks for the help.

I checked for that line in the export list and I do have a line:

Declare -x JAVA_HOME="/usr/local/src/j2sdk1.4.2._17"

When I su to user lenya (the username I am running in lenya125).

However. I am still getting that JAVA_HOME error when I run the lenya125
script.

I do have the sdk version of JAVA installed (j2sdk1.4.2_17) and lenya
works when I run ./lenya.sh from the command line as user lenya.

I must be overlooking something but I can't figure out what.

Brian



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Startup Script for Lenya

Posted by so...@apache.org.
On 6/25/08, Kimsey-Hickman, Brian <Br...@occompt.com> wrote:
> Solprovider,
>  Thanks, that is a lot further than I could have ever gotten by myself.
>  However, my start.log is giving me the following error:
>  You must set JAVA_HOME to point at your JAVA Development Kit
>  installation
>  But I have set JAVA_HOME in lenya125
>  I even added a line under start() {
>         echo "JAVA_HOME=$JAVA_HOME"
>  And the JAVA_HOME variable is set to the right location but for some
>  reason it does not seem to be passing that to the lenya.sh process.  Do
>  I have to define this variable with the lenya.sh file then?
>  Thanks,
>  Brian

No, JAVA_HOME should not need to be set in lenya.sh.

After the startup script runs, login as the user specified as
lenyauser in the startup script.  From the command line, type:
   export
The list should contain a line like:
   declare -x JAVA_HOME="/opt/j2sdk1.4.2_08"
That is what Lenya uses.

The error message mentions the JDK.  Do you have the JDK or the JRE installed?

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


RE: Startup Script for Lenya

Posted by "Kimsey-Hickman, Brian" <Br...@occompt.com>.
Solprovider,

Thanks, that is a lot further than I could have ever gotten by myself.
However, my start.log is giving me the following error:

You must set JAVA_HOME to point at your JAVA Development Kit
installation

But I have set JAVA_HOME in lenya125

I even added a line under start() {

	echo "JAVA_HOME=$JAVA_HOME"

And the JAVA_HOME variable is set to the right location but for some
reason it does not seem to be passing that to the lenya.sh process.  Do
I have to define this variable with the lenya.sh file then?

Thanks,

Brian  



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Startup Script for Lenya

Posted by so...@apache.org.
A startup script being used on an old version of RedHat is attached.
The filename is "lenya125" because several instances of Lenya are
installed on the server and sometimes run on different ports
(specified as JETTY_PORT in lenya.sh in the Lenya directory.)

Enjoy,
solprovider

On 6/24/08, Kimsey-Hickman, Brian <Br...@occompt.com> wrote:
> Has anybody come up with a startup script for Lenya on standalone so it
>  can be run as a daemon in Linux?  Something that could be used or
>  adapted to be used in Red Hat?  I don't seem to be able to find
>  anything.
>  Thanks,
>  Brian