Fedora Linux Support Community & Resources Center
  #1  
Old 21st December 2007, 02:07 AM
axiopisty Offline
Registered User
 
Join Date: Jan 2006
Location: Utah, USA
Posts: 59
How do I start tomcat automatically when the computer starts?

Hi All,

I am running FC5. I installed MySQL, Apache HTTPD, and Tomcat 5.5.

Putting the following commands in the /etc/rc.local file start the mysql and httpd servers just fine.
/bin/sh -c 'cd /path/mysql; ./bin/mysqld_safe &'
/bin/sh -c 'cd /path/apache2; ./bin/httpd &'

But when I put the following command in the same file the tomcat server does not start.
/bin/sh -c 'cd /path/tomcat; ./bin/startup.sh &'

Does anyone know why tomcat doesn't start at system startup?
What do I need to do to get Tomcat to start at system startup?

Thanks,
Axiopisty
Reply With Quote
  #2  
Old 21st December 2007, 02:34 AM
scottro Offline
Retired Community Manager -- Banned from Texas by popular demand.
 
Join Date: Sep 2007
Location: NYC
Posts: 8,142
Give it some catnip? Actually, depending upon how you installed them, it shouldn't even be necessary to use rc.local, there should be an entry in /etc/init.d. If there is, then all you have to do is /sbin/chkconfig tomcat on

Were there any errors that you saw in /var/log/messages? (Sigh, I know I'm always whining about BSD, but that's another nice thing--you can use dmesg -a as in all and see what's happening when local programs start--in Fedora, AFAICT, they're either in /var/log/messages, or possibly their own log in /var/log.)
Reply With Quote
  #3  
Old 21st December 2007, 03:39 AM
axiopisty Offline
Registered User
 
Join Date: Jan 2006
Location: Utah, USA
Posts: 59
Quote:
Originally Posted by scottro
Actually, depending upon how you installed them, it shouldn't even be necessary to use rc.local, there should be an entry in /etc/init.d. If there is
... There isn't. I installed from a .tar.gz file so I just untar'd it in a directory, exported the bin directory, and created some sym links.

If I start it manually it works fine. I just can't get it to start automatically when the system starts.

Even if "it shouldn't be necessary" I would think it would be a possibility. Does anyone know why it isn't working and what I need to do so it will work?

Thanks,
Axiopisty
Reply With Quote
  #4  
Old 21st December 2007, 02:42 PM
mattywix Offline
Registered User
 
Join Date: Dec 2007
Posts: 110
there are many ways to create services in linux.
The simplest but least elegant way is to be lazy and do what AIX admins do - create a rc.local file in /etc/ and stick your startup in there (i.e set up JAVA_HOME, cd to $CATALINA_HOME/bin, startup.sh). Then ensure the rc.local is started in /etc/inittab for your runlevel.

Better though is to create a script in /etc/init.d (just copy one already there and modify it for yourself), then use chkconfig to enable it for your runlevel. Make sure you put the chkconfig comment in the top so chkconfig can do this.
__________________
Mattywix

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return." - Leonardo da Vinci speaks of his joy at experiencing Linux
Reply With Quote
Reply

Tags
automatically, start, starts, tomcat

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Computer freezes when installation starts windandfire Installation, Upgrades and Live Media 4 14th January 2008 03:57 AM
network always off when computer starts pp_muscimol Servers & Networking 5 15th February 2007 08:56 PM
firestarter never starts automatically joey111 Installation, Upgrades and Live Media 7 15th December 2006 06:18 AM
How can I make a program start up automatically after the computer restart/startup? jcal Using Fedora 12 7th December 2006 10:08 AM
XMMS starts automatically when KDE starts Mat Using Fedora 20 8th August 2004 04:34 PM


Current GMT-time: 22:24 (Tuesday, 23-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat