LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to set up tomcat 5 to boot at startup ? (http://www.linuxquestions.org/questions/linux-newbie-8/how-to-set-up-tomcat-5-to-boot-at-startup-255011/)

jorgepinho 11-15-2004 06:28 AM

How to set up tomcat 5 to boot at startup ?
 
Hi all

I am using Fedora Core 2 (I am very new at Linux)

I am trying to understand how to startup apps at OS startup.

when searching the net, I found a solution for the problem...

Create a new file:
/etc/profile.d/tomcat.sh

with the lines:
JAVA_HOME=/usr/local/j2sdk1.4.2_04
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH
/usr/local/jakarta-tomcat-5.0.27/bin/startup.sh


this works, but know.... everytime I open a console window, this file is executed.

So, Anyone can help me how to set up Tomcat as a Service-like (in Windows), so that it starts only with the OS ?

I found something about the jsvc tool, but nothing practical...

any help ?

thankx a lot ;)

huibert.alblas 11-15-2004 08:13 AM

Almost correct
 
the profile.d dir is apparently not the correct place,
as you report the Tomcat is started everytime you open a console.

The correct place for your script would be /etc/init.d

To work correctly your script should be able to handle start, stop and restart parameters correctly.
Look into the other scripts in this directory, the principle is really simple.

Then look in /etc/inittab for the entry

defaultrunlevel=?

This is you default runlevel at boot, often 5 or 3.

do a cd /etc/rc3.d or /etc/rc5.d (defined by your default runlevel)
and add a symlink like this:

ln -s /etc/init.d/tomcat.sh S99tomcat.sh

Now, whenever your system boots, tomcat will be started automaticly.

There are some tools to handle this, but I think you should get to know the internals,
before you use these tools.


All times are GMT -5. The time now is 01:50 AM.