LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-20-2004, 01:28 AM   #1
bumeshrai
LQ Newbie
 
Registered: Jul 2004
Posts: 13

Rep: Reputation: 0
Service Configuration Tool


How does one add a service to service configuration tool ?

I had installed Tomcat 5 on Fedora 2 the hard way, by first installing JVM, then Tomcat 5 etc..

As this service is not featuring in Service Configuration Tool, I tried to add it at any of the Run Level, but whenever I click on add service box with name tomcat, I get the following error:

"error reading information on service tomcat: No such file or directory"

The service runs from the terminal window on the following command: $CATALINA_HOME/bin/startup.sh
Where CATALINA_HOME is the home directory of tomcat

Only problem in running from terminal window is that it doesn't start automatically after reboot.
 
Old 07-20-2004, 10:19 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
This link explains init scripts. You probably want to base your script on the ones in /etc/init.d or /etc/rc.d ( one may be a link to the other directory ). There may be some commented lines at the top that determine where the service configuration tool will link them ( I.E. which run levels and what the dependencies are ).

http://www.lysator.liu.se/~forsberg/...nit-files.html
and another link:
http://freebooks.by.ru/view/RedHatLi...d/rhl6u059.htm

The quick & dirty, lazy & wrong way to do it is to have your startup command saved in a simple script and called something like S##tomcat5 and the shutdown script named K##tomcat5 where the ## represents a number which determines the boot order of the script.

I believe that the tomcat service should start after the apache service, so make sure the the S## number is greater then the one for the httpd daemon, and less then the number for the K##httpd service.

Normally the actual script is located in the /etc/init.d directory and the scripts in /etc/init.d/rc.5 are links to the corresponding script in /etc/init.d. So a script called S25httpd will be a link to the httpd script. The K13httpd script will be a link to the same httpd script. (note, I just pulled the numbers 25 and 13 out of the air to make the example clearer )
---
Another place to start the service is to add a line to the rc.local script. You might want to include a test to see if the httpd daemon is running before starting it.
__
If you want to write your own script, look for a script called skeleton in the init.d or rc.d directory and use it as a start. And if possible, use the Service Configuration Tool to produce the links in the runlevel subdirectories.
___

Also google for Tomcat 5. I saw a webpage that contained a lot of information on installing and using Tomcat.

Good Luck!
 
Old 07-21-2004, 02:15 AM   #3
bumeshrai
LQ Newbie
 
Registered: Jul 2004
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks. Your post and links have got me going. After googling I finally ended with this script file:

----------------------------
----------------------------
#!/bin/sh
# Tomcat 5 init script for Fedora 2
#
# chkconfig: 345 86 14
# description: tomcat

export CATALINA_HOME=/usr/local/jakarta-tomcat-5.0.27
start_tomcat=$CATALINA_HOME/bin/startup.sh
stop_tomcat=$CATALINA_HOME/bin/shutdown.sh

start() {
echo -n "Starting tomcat: "
su -c ${start_tomcat} - tomcat
echo "done."
}
stop() {
#echo -n "Shutting down http: "
echo -n "Shutting down tomcat: "
${stop_tomcat}
echo "done."
}

# See how we were called
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 10
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac

exit 0
-----------------------------------------
-----------------------------------------

This file I named as tomcat and placed it in /etc/rc.d/init.d Then I used the Service Configuration tool to add tomcat service. It added but in the status it displayed the following message:
tomcat: unrecognized service

And when I try to run it:, it gives the following error message:
tomcat failed. The error was: tomcat: unrecognized service

Please help, as I think I am nearly there but missing something important.
 
Old 07-21-2004, 03:09 AM   #4
bumeshrai
LQ Newbie
 
Registered: Jul 2004
Posts: 13

Original Poster
Rep: Reputation: 0
I got it!

I had forgotten to do the following command:
chmod +x /etc/rc.d/init.d/tomcat

Now it is starting and stopping perfectly.

Thank you
 
Old 07-21-2004, 03:40 AM   #5
Baltasar
Member
 
Registered: Jan 2004
Distribution: Fedora & Debian
Posts: 43

Rep: Reputation: 15
Is there a reason why you installed Tomcat5 and JVM the hard way?
You could add the www.jpackage.org yum repository to your /etc/yum.conf and run
Code:
yum update
yum install tomcat5
all dependencies will be resolved!
 
Old 07-21-2004, 04:16 AM   #6
bumeshrai
LQ Newbie
 
Registered: Jul 2004
Posts: 13

Original Poster
Rep: Reputation: 0
I had used the bundled tomcat rpms initially, but my jsp/struts application was not running on them. During googling I found out that they were using a different jvm etc. So I switched to the original j2sdk and tomcat. Also this j2sdk was needed for my netbeans ide.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
help! can not use X configuration Tool njlg Linux - Newbie 7 11-16-2005 03:14 PM
Service configuration tool ray alex Fedora 12 06-04-2005 10:45 AM
Piranha Configuration Tool cAg3 Linux - Software 0 11-15-2004 06:50 PM
X configuration problem - OR - Where did the configuration tool go??? t3kn0lu5t Debian 3 09-25-2003 08:19 PM
PPPoe Configuration Tool navel_lint Linux - Software 1 01-24-2003 03:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:02 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration