LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 08-11-2004, 11:57 AM   #1
Greenman
Member
 
Registered: Jan 2003
Posts: 34

Rep: Reputation: 15
Getting Tomcat to start on Boot


Hi,


How do get Redhat to run Tomcat on startup

I have tried adding this

/var/www/jakarta-tomcat-5.0.27/bin/./startup.sh
to
/etc/rc.d/rc.local

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

If I run this line manually it starts fine?

Ta

G
 
Old 08-11-2004, 01:51 PM   #2
aqoliveira
Member
 
Registered: Dec 2001
Location: Portugal
Distribution: /Red Hat/Fedora/Solaris
Posts: 620

Rep: Reputation: 30
Howzit

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

./var/www/jakarta-tomcat-5.0.27/bin/startup.sh

chow
 
Old 08-12-2004, 05:46 AM   #3
Greenman
Member
 
Registered: Jan 2003
Posts: 34

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

./var/www/jakarta-tomcat-5.0.27/bin/startup.sh


?
@L@
~

G
 
Old 08-14-2004, 09:32 AM   #4
Greenman
Member
 
Registered: Jan 2003
Posts: 34

Original Poster
Rep: Reputation: 15
Question

Any ideas folks?

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

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

./var/www/jakarta-tomcat-5.0.27/bin/startup.sh
 
Old 11-22-2004, 09:41 AM   #6
jpowys
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:

#!/bin/sh
# chkconfig: - 85 15
# description: Tomcat is a servlet container

PROGRAM=$CATALINA_HOME/bin/startup.sh
if [ -f $PROGRAM ]; then
echo "$1ing" `basename $0`
su - tomcat -c "$PROGRAM $1"
fi


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).

/jeep/
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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


All times are GMT -5. The time now is 11:17 PM.

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