LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 08-27-2002, 07:30 PM   #1
azure_ss
LQ Newbie
 
Registered: Aug 2002
Posts: 11

Rep: Reputation: 0
How to autostart tomcat?


Can anybody out there please tell me how to AutoStart Tomcat4 in the background on a RedHat Linux box without having to log in and start the service manually? I know that if I log in as a user I can add them in the .bash_profile.But how about if I want to start tomcat without having to log in?Where can I add the environment var?Please give detail procedure for I am new for linux
Thanks for any help in advance
 
Old 08-27-2002, 09:22 PM   #2
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 55
All you need is to read the documentation provided with tomcat it is in /your/tomcat/directory/docs directory
There is a script in tomact diretory under bin/ called startup.sh
you can put the path to it in your /etc/rc.local
I'd suggest though creating symlinks in /etc/rc?.d directories where ? is a runlevel you want tmcat to start in
teh symlinks are easy
in these /etc/rc?.d/ directories
ls
note that every file there is a symlink that starts either with S (for start) or K (for stop), also note the sequence number that follows S or K, pick the number in high 80's that is not occupied
ln -s /where/tomcat/is/bin/tomcat.sh SNumberYouPickedtomcat
then in runlevel 0 and 6 you must create symlinks that stop tomcat
cd /etc/rc6.d
ln -s /where/tomcat/is/bin/tomcat.sh KTheSameNumberYouPickedtomcat
and the same goes to /etc/rc0.d
 
Old 08-27-2002, 10:20 PM   #3
azure_ss
LQ Newbie
 
Registered: Aug 2002
Posts: 11

Original Poster
Rep: Reputation: 0
But I still need to set the JAVA_HOME and PATH environment vars right?I just wonder where can I add this vars for I want to start the tomcat without having to log in.

Last edited by azure_ss; 08-27-2002 at 10:23 PM.
 
Old 08-27-2002, 10:27 PM   #4
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 55
you can put export statements in /etc/rc file
 
Old 08-29-2002, 10:10 AM   #5
azure_ss
LQ Newbie
 
Registered: Aug 2002
Posts: 11

Original Poster
Rep: Reputation: 0
thanks neo.
But I am using tomcat4.04 on redhat 7.1.In this version the startup file is startup.sh and the shutdown cript is shutdown.sh.
So when I create symlinks that stop tomcat.I should link the shutdown.sh instead of startup.sh,right?
 
Old 08-29-2002, 12:24 PM   #6
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 55
Not really, if you look inside of shatdown.sh or startup.sh they are just shell scripts that stop and start tomcat.sh respectively. I think it didn't change since tomcat3. Look up the tomcat.sh script. In srartup.sh it is called
tomcat.sh start
and in shutdown.sh
tomcat.sh stop.
So making symlinks to tomcat.sh is sufficient. The init process will pass stop and start flags to it on its own.
 
  


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
Debian - Problems autostart Tomcat 4.1.30 on boot KaminariJ Linux - Software 5 10-13-2004 07:25 AM
autostart noobtesting Mandriva 3 07-04-2004 11:45 AM
TOMCAT init script not working on startup -- tomcat 4.x / Mandrake Linux 8.0 jmartinph Mandriva 0 03-08-2004 01:31 AM
Why use Apache with Tomcat rather than just Tomcat itself? davee Linux - Software 1 08-21-2003 09:47 PM
How to autostart tomcat? azure_ss Linux - General 1 08-28-2002 11:33 AM


All times are GMT -5. The time now is 03:43 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