The best way to start tomcat service

L

lightning

In tomcat's bin folder,there are some "sh"s to start the server,which
just " exec java ...... &".
You know that when the terminal closed or the user who launch that
"sh" logged out, the java process may end.

In your mind of best and simple practice, how would you start tomcat
as a service in linux?
 
A

Arne Vajhøj

lightning said:
In tomcat's bin folder,there are some "sh"s to start the server,which
just " exec java ...... &".
You know that when the terminal closed or the user who launch that
"sh" logged out, the java process may end.

In your mind of best and simple practice, how would you start tomcat
as a service in linux?

There are plenty of script son the net:

http://www.meritonlinesystems.com/docs/apache_tomcat_redhat.html
http://blog.aujava.com/?p=15

were at the top of my Google search.

Arne
 
N

Nigel Wade

lightning said:
In tomcat's bin folder,there are some "sh"s to start the server,which
just " exec java ...... &".
You know that when the terminal closed or the user who launch that
"sh" logged out, the java process may end.

Try nohup.
In your mind of best and simple practice, how would you start tomcat
as a service in linux?

The normal mechanism is to copy a startup script for you particular flavour of
Linux and edit it to work for Tomcat. This fully integrates Tomcat
start/stop/enable/disable into the usual control mechanism. How your version of
Linux controls daemon startup depends on the distro you are using.

For example, in RedHat you would have the control script in /etc/init.d. It
would contain the necessary "comments" for chkconfig to enable and disable the
script in the various run levels. Tomcat then becomes another service which can
be controlled by the usual OS commands, 'service start/stop', 'chkconfig
on/off' etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,134
Latest member
Lou6777736
Top