LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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
  Search this Thread
Old 05-16-2012, 04:08 AM   #1
fachhoch@gmail.com
Member
 
Registered: Apr 2010
Posts: 82

Rep: Reputation: 1
unable to stop start tomcat


I placed tomcat file in /etc/init.d

here is the content of file
Code:
#!/bin/sh

# A slightly better Apache Tomcat start/stop script

#

# chkconfig: 345 80 20

# description: Apache Tomcat



# Source the init.d function library

. /etc/init.d/functions



RETVAL="0"



case $1 in

start)

        echo "Starting Tomcat:"

        /bin/su -s /bin/sh - tomcat -c /opt/apache-tomcat-6.0.35/bin/startup.sh

        RETVAL=$?

        [ $RETVAL = 0 ] && touch /var/lock/subsys/tomcat

        ;;

stop)

        echo "Stopping Tomcat:"

        /bin/su -s /bin/sh - tomcat -c /opt/apache-tomcat-6.0.35/bin/shutdown.sh

        RETVAL=$?

        [ $RETVAL = 0 ] && rm -f /var/lock/subsys/tomcat

        ;;

restart)

        $0 stop

        $0 start

        ;;

condrestart)

        [ -e /var/lock/subsys/tomcat ] && $0 restart

        ;;

status)

        status tomcat

        ;;

*)

        echo "Usage: $0 {start|stop|restart|status}"

        RETVAL="1"

esac

exit $RETVAL
also to resolve issues with pid another file in /var/run/tomcat.pid

here contents
Code:
start)

        echo "Starting Tomcat:"

        # Fix pid file permissions

        touch /var/run/tomcat.pid 2>&1 || RETVAL="4"

        if [ "$RETVAL" -eq "0" -a "$?" -eq "0" ]; then

              chown tomcat:tomcat /var/run/tomcat.pid

        fi

        /bin/su -s /bin/sh - tomcat -c /opt/apache-tomcat-6.0.35/bin/startup.sh


stop)

        echo "Stopping Tomcat:"

        /bin/su -s /bin/sh - tomcat -c /opt/apache-tomcat-6.0.35/bin/shutdown.sh

        RETVAL=$?

       [ $RETVAL = 0 ] && rm -f /var/lock/subsys/tomcat /var/run/tomcat.pid

I run the command

service tomcat stop

Code:
[root@ip-10-140-5-209 /]# service tomcat stop
Stopping Tomcat:
Using CATALINA_BASE:   /opt/apache-tomcat-6.0.35
Using CATALINA_HOME:   /opt/apache-tomcat-6.0.35
Using CATALINA_TMPDIR: /opt/apache-tomcat-6.0.35/temp
Using JRE_HOME:        /opt/jre1.6.0_32
Using CLASSPATH:       /opt/apache-tomcat-6.0.35/bin/bootstrap.jar
Using CATALINA_PID:    /var/run/tomcat.pid
Tomcat did not stop in time. PID file was not removed.
Please help me resolve this.
 
  


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
unable to start tomcat 6 on fedora while running liferay on fedora sawgata Fedora 5 05-26-2010 05:24 PM
Informix start/stop along with redhat start/stop gxgtudor Red Hat 2 03-06-2009 02:13 AM
AWK- processing data inside start/stop pairs but ignoring start/stop lines cliffoij Programming 2 10-15-2008 06:17 AM
Tomcat Unable to Start - Exception PerfectReign Linux - Software 2 08-10-2006 05:24 PM
Unable to start Tomcat 4 on Linux Manav Linux - Newbie 5 08-22-2003 05:59 AM


All times are GMT -5. The time now is 06:28 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration