LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 04-17-2012, 12:36 AM   #1
call_krushna
Member
 
Registered: Aug 2007
Location: India
Distribution: Ubuntu
Posts: 173

Rep: Reputation: 1
How to stop tomcat 6.0


Hi Team,

After stopping tomcat process with shutdown command , I am able to see so may tomcat process .

I use command to stop tomcat is

#/home/<myname>/liferay-portal-6.0.6/tomcat-6.0.29/bin/.shutdown.sh


Using CATALINA_BASE: /home/ubuntu/liferay-portal-6.0.6/tomcat-6.0.29
Using CATALINA_HOME: /home/ubuntu/liferay-portal-6.0.6/tomcat-6.0.29
Using CATALINA_TMPDIR: /home/ubuntu/liferay-portal-6.0.6/tomcat-6.0.29/temp
Using JRE_HOME: /home/ubuntu/jdk1.6.0_31
Using CLASSPATH: /home/ubuntu/liferay-portal-6.0.6/tomcat-6.0.29/bin/bootstrap.jar
Apr 17, 2012 5:21:07 AM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:189)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:408)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:338)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:416)

#ps -aef |grep tomcat|grep -v grep


root 1851 1 2 04:42 pts/0 00:01:09 /home/ubuntu/jdk1.6.0_31/bin/java -Djava.util.logging.config.file=/home/ubuntu/liferay-portal-6.0.6/tomcat-6.0.29/conf/logging.properties -Dfile.encoding=UTF8 -Duser.timezone=GMT -Xmx1024m -XX:MaxPermSize=256m -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/home/ubuntu/liferay-portal-6.0.6/tomcat-6.0.29/endorsed -classpath /home/ubuntu/liferay-portal-6.0.6/tomcat-6.0.29/bin/bootstrap.jar -Dcatalina.base=/home/ubuntu/liferay-portal-6.0.6/tomcat-6.0.29 -Dcatalina.home=/home/ubuntu/liferay-portal-6.0.6/tomcat-6.0.29 -Djava.io.tmpdir=/home/ubuntu/liferay-portal-6.0.6/tomcat-6.0.29/temp org.apache.catalina.startup.Bootstrap start

#netstat -nap |grep 80

tcp6 1 0 10.224.114.12:53099 <ip>:80 CLOSE_WAIT 1851/java
tcp6 1 0 10.224.114.12:60320 <ip>:80 CLOSE_WAIT 1851/java
udp 0 0 0.0.0.0:38038 0.0.0.0:* 715/avahi-daemon: r
unix 3 [ ] STREAM CONNECTED 28024 705/dbus-daemon /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 28023 5514/su

Please let me know, is there any command to stop tomcat status and check the status of tomcat

Tomcat version :- 6.0.6

OS :- Ubuntu 10.10 (64bit)

Tomcat running port 80

Any help is highly appreciable .


Thanks in advance
 
Old 04-17-2012, 08:10 AM   #2
Felipe
Member
 
Registered: Oct 2006
Posts: 302

Rep: Reputation: 32
Hello:

If you edit shutdown.sh you will see it calls catalina.sh with the parameters you pass to shutdown.

You can try with:
Quote:
./shutdown 5 -force
to force stop tomcat if it doesn't stop in 5 seconds.

To know if the instance is running, you can configure the variable CATALINA_PID.
It's recommned to create a file in called $CATALINA_BASE/bin/setenv.sh (and set +x permission) where you define the variables:
Example:
Quote:
export ANT_HOME=/opt/ant
export JAVA_HOME=/opt/java6
export JAVA_OPTS="-XX:PermSize=128m -XX:MaxPermSize=256m"
export CATALINA_HOME="/opt/tomcat6"
export CATALINA_BASE="$CATALINA_BASE"
export CATALINA_TMPDIR=$CATALINA_BASE/temp
export CATALINA_PID="$CATALINA_HOME/run/tomcat6-instance1"
The setenv.sh is read automatically when starting and stopping tomcat.

You will have to create the $CATALINA_HOME/run directory.

If you want to know if tomcat is up,
Quote:
ls $CATALINA_HOME/run
will list the instances which are up.
 
1 members found this post helpful.
Old 04-17-2012, 08:11 AM   #3
Felipe
Member
 
Registered: Oct 2006
Posts: 302

Rep: Reputation: 32
Forgot to say that if you use port 80, you are root, so you can use
CATALINA_PID=/var/run/tomcat6-instance1

Regards
 
1 members found this post helpful.
  


Reply



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
Session replication using apache+mod_jk+tomcat(5.5.28-veriosn of tomcat) sreejithp Linux - Server 1 12-24-2010 06:46 AM
Tomcat 6.0 on Linux, after modifying tomcat-users.xml still cannot login. cuian01 Linux - Newbie 1 01-28-2010 03:45 AM
fresh tomcat 5.5 install not showing tomcat homepage laggerific Linux - Software 0 10-26-2007 03:28 PM
TOMCAT init script not working on startup -- tomcat 4.x / Mandrake Linux 8.0 jmartinph Mandriva 0 03-08-2004 01:31 AM

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

All times are GMT -5. The time now is 04: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
Open Source Consulting | Domain Registration