tomcat

Discussion of programming on Linux, including shell scripting, perl, python, c/c++, mono, java. Whatever tickles your fancy.
Post Reply
saquib_javed
Naib Subedar
Posts: 344
Joined: Sat Apr 10, 2004 9:07 pm
Location: Karachi
Contact:

tomcat

Post by saquib_javed »

i have installed tomcat in /opt/tomcat from a zip file

how can i install it's service; i mean automatically start up in runlevel 5 or 3

moreover if i remove the tomcat now how the services will be cleaned
Use Linux and feel Free.
OR
Feel free to use Linux. ;)
nomankhn
Colonel
Posts: 714
Joined: Wed Aug 07, 2002 8:00 pm

Re: tomcat

Post by nomankhn »

saquib_javed wrote:i have installed tomcat in /opt/tomcat from a zip file

how can i install it's service; i mean automatically start up in runlevel 5 or 3

moreover if i remove the tomcat now how the services will be cleaned
Dear,

Read your documentation, from which method you install , so go in docs and got ur point,
if u install through rpm , so simple rpm -e tomcat*.

Regards
Noman Liaquat Khanzada Rajput
Linux means productivity and fun.
We all love Linux, but it's also a fact that some people might not be able to migrate.
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re: tomcat

Post by LinuxFreaK »

Dear saquib_javed,
Salam,

[quote="saquib_javed"]i have installed tomcat in /opt/tomcat from a zip file/quote]

There is a startup and shutdown file in /opt/tomcat/bin check that out it will help you alot.

Best Regards.
Farrukh Ahmed
saquib_javed
Naib Subedar
Posts: 344
Joined: Sat Apr 10, 2004 9:07 pm
Location: Karachi
Contact:

Post by saquib_javed »

thanks dudes i know there are startup and shutdown scripts in bin directory (as a j2ee developer) and still i know that there are the rpms; but i already have mentioned that i have extracted it from a zip file and want to register those startup and shutdown scripts as systems services
:?
Use Linux and feel Free.
OR
Feel free to use Linux. ;)
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

Dear saquib_javed,
Salam,
saquib_javed wrote:thanks dudes i know there are startup and shutdown scripts in bin directory (as a j2ee developer) and still i know that there are the rpms; but i already have mentioned that i have extracted it from a zip file and want to register those startup and shutdown scripts as systems services
:?
Copy below script into /etc/init.d/tomcat

Code: Select all

#!/bin/bash
#
# tomcat        
#
# chkconfig: 
# description: 	Start up the Tomcat servlet engine.

# Source function library.
. /etc/init.d/functions


RETVAL=$?
CATALINA_HOME="/opt/tomcat"

case "$1" in
 start)
        if [ -f $CATALINA_HOME/bin/startup.sh ];
          then
	    echo $"Starting Tomcat"
            /bin/su tomcat $CATALINA_HOME/bin/startup.sh
        fi
	;;
 stop)
        if [ -f $CATALINA_HOME/bin/shutdown.sh ];
          then
	    echo $"Stopping Tomcat"
            /bin/su tomcat $CATALINA_HOME/bin/shutdown.sh
        fi
 	;;
 *)
 	echo $"Usage: $0 {start|stop}"
	exit 1
	;;
esac

exit $RETVAL
# chmod +x /etc/init.d/tomcat
# chkconfig --level 3,5 tomcat on
# /etc/init.d/tomcat start


Best Regards.
Farrukh Ahmed
saquib_javed
Naib Subedar
Posts: 344
Joined: Sat Apr 10, 2004 9:07 pm
Location: Karachi
Contact:

Post by saquib_javed »

:D
Oh yes thats what i wanted to do
thanks LinuxFreaK
:D
thanks man
Use Linux and feel Free.
OR
Feel free to use Linux. ;)
nomankhn
Colonel
Posts: 714
Joined: Wed Aug 07, 2002 8:00 pm

Post by nomankhn »

Wah wah,

kia bat ha, be happy.

Regards
Noman Liaquat Khanzada Rajput
Linux means productivity and fun.
We all love Linux, but it's also a fact that some people might not be able to migrate.
saquib_javed
Naib Subedar
Posts: 344
Joined: Sat Apr 10, 2004 9:07 pm
Location: Karachi
Contact:

Post by saquib_javed »

??? :?
Use Linux and feel Free.
OR
Feel free to use Linux. ;)
Post Reply