Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Red Hat This forum is for the discussion of Red Hat Linux.


  Search this Thread
Old 08-11-2004, 12:57 PM   #1
Registered: Jan 2003
Posts: 34

Rep: Reputation: 15
Getting Tomcat to start on Boot


How do get Redhat to run Tomcat on startup

I have tried adding this


but unfortunately it doesn’t seem to execute the script when the machine starts up.

If I run this line manually it starts fine?


Old 08-11-2004, 02:51 PM   #2
Registered: Dec 2001
Location: Portugal
Distribution: /Red Hat/Fedora/Solaris
Posts: 622

Rep: Reputation: 30

Try placing the same the line in this way in the same file.


Old 08-12-2004, 06:46 AM   #3
Registered: Jan 2003
Posts: 34

Original Poster
Rep: Reputation: 15
Thanks but no joy when I inserted this into /etc/rc.d/rc.local



Old 08-14-2004, 10:32 AM   #4
Registered: Jan 2003
Posts: 34

Original Poster
Rep: Reputation: 15

Any ideas folks?

Old 08-16-2004, 08:02 AM   #5
Registered: Jan 2003
Posts: 34

Original Poster
Rep: Reputation: 15
Can I put this in another file that will be run on startup?

Old 11-22-2004, 10:41 AM   #6
LQ Newbie
Registered: Nov 2004
Posts: 1

Rep: Reputation: 0
I wanted tomcat to start as a service, so I used a script I found (forget whose) and tweaked it a bit. I have tomcat run as a user, and in order to do so I had to set environment variables as that user. If you set the user to nologin then I think it uses /etc/profile for it's env settings, so you have to set JAVA_HOME and CATALINA_HOME and export them from there. Anyway, once you've made user tomcat, you can pop into init.d (as root) and make a small executable file called tomcat:

# chkconfig: - 85 15
# description: Tomcat is a servlet container

if [ -f $PROGRAM ]; then
echo "$1ing" `basename $0`
su - tomcat -c "$PROGRAM $1"

now tomcat is a "service" that will start with your computer and can be started and stopped with "service tomcat start" or "service tomcat stop", this also lets you control it from kde/gnome with redhat-config-services.

I hope that will work for you as well. I honestly don't know what most of the file means, but it does work, and it looks very much like the other files in init.d, so I assume it belongs there.

I used this for both fedora core 2 and 3, and whitebox linux 3 (which is better known as RHEL3).



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tomcat 5.5.4 Wont start! tmasood Linux - General 0 12-31-2004 10:43 AM
start tomcat problem varunbihani Linux - Software 0 05-06-2004 06:30 PM
How to start Apache and Tomcat with Linux boot montejr Linux - Newbie 2 04-23-2004 03:03 PM
tomcat on start up mikeshn Linux - Software 1 09-02-2002 12:35 PM
How to start scriptfile(tomcat) automatically at boot-time run fmohideen76 Linux - General 4 07-11-2002 11:44 PM > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 10:13 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration