ÍôÐÇÈË ·¢±íÓÚ 2014-3-1 21:44

linuxÍ£Ö¹tomcatΪʲôҪkillÆäµô½ø³Ì ¶ø²»ÊÇÖ±½Óshutdown.sh

ÔËÐÐtomcat/bin/shutdown.sh,tomcatÍ£Ö¹£¬µ«ËüµÄjava½ø³Ì»¹ÔÚ£¬Ê²»¹ý״̬ΪS(sleep)£¬²»ÊÇÔËÐÐʱµÄR(Runnable)£¬Èç¹û²»killµÄ»°£¬ÕâÖÖ½ø³ÌÔ½À´Ô½¶à
´ò¿ªÖÕ¶Ë
cd /java/tomcat
#Ö´ÐÐ
bin/startup.sh #Æô¶¯tomcat
bin/shutdown.sh #Í£Ö¹tomcat
tail -f logs/catalina.out #¿´tomcatµÄ¿ØÖÆ̨Êä³ö£»

#¿´ÊÇ·ñÒѾ­ÓÐtomcatÔÚÔËÐÐÁË
ps -ef |grep tomcat
#Èç¹ûÓУ¬ÓÃkill;
kill -9 pid #pid ΪÏàÓ¦µÄ½ø³ÌºÅ

ÀýÈç ps -ef |grep tomcat Êä³öÈçÏÂ
sun 5144 1 0 10:21 pts/1 00:00:06 /java/jdk/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/java/tomcat/common/endorsed -classpath :/java/tomcat/bin/bootstrap.jar:/java/tomcat/bin/commons-logging-api.jar -Dcatalina.base=/java/tomcat -Dcatalina.home=/java/tomcat -Djava.io.tmpdir=/java/tomcat/temp org.apache.catalina.startup.Bootstrap start

Ôò 5144 ¾ÍΪ½ø³ÌºÅ pid = 5144
kill -9 5144 ¾Í¿ÉÒÔ³¹µ×ɱËÀtomcat

#Ö±½Ó²é¿´Ö¸¶¨¶Ë¿ÚµÄ½ø³Ìpid
netstat -anp|grep 9217
#½á¹ûΪ tcp      0      0 :::9217                     :::*                        LISTEN      26127/java
#Ôò26127Ϊ9217Õâ¸ö¶Ë¿ÚµÄtomcat½ø³ÌµÄpid,È»ºó¾Í¿ÉÒÔkillÕâ¸ö½ø³Ì
kill -9 26127
#È»ºóÔÙÆô¶¯tomcat¼´¿É


Ò³: [1]
²é¿´ÍêÕû°æ±¾: linuxÍ£Ö¹tomcatΪʲôҪkillÆäµô½ø³Ì ¶ø²»ÊÇÖ±½Óshutdown.sh