zoukankan      html  css  js  c++  java
  • linux使用shutdown.sh命令关闭不完tomcat进程的处理方法

    1、修改bin/catalina.sh文件
       查找PRGDIR=`dirname "$PRG"` 这一行;
       在这一行的下面增加如下3行语句:
       if [ -z "$CATALINA_PID" ]; then
         CATALINA_PID=$PRGDIR/CATALINA_PID

          cat $CATALINA_PID
       fi
       功能:判断 CATALINA_PID有没有配置,
       没有的话,就使用当前目录(bin)
       的CATALINA_PID文件来记录tomcat的进程ID

    2、修改tomcat的shutdown.sh文件,在最后一行加上“-force”:   
       找到命令行: exec "$PRGDIR"/"$EXECUTABLE" stop "$@" 
       修改为:exec "$PRGDIR"/"$EXECUTABLE" stop -force "$@" 
       保存即可。

    关闭tomcat时效果如下:
    #./startup.sh
    Using CATALINA_BASE:   /opt/apps/tomcat9-www
    Using CATALINA_HOME:   /opt/apps/tomcat9-www
    Using CATALINA_TMPDIR: /opt/apps/tomcat9-www/temp
    Using JRE_HOME:        /opt/apps/jdk1.8.0_181
    Using CLASSPATH:       /opt/apps/tomcat9-www/bin/bootstrap.jar:/opt/apps/tomcat9-www/bin/tomcat-juli.jar
    Using CATALINA_PID:    /opt/apps/tomcat9-www/bin/CATALINA_PID
    Tomcat started.

    #./shutdown.sh
    Using CATALINA_BASE:   /opt/apps/tomcat9
    Using CATALINA_HOME:   /opt/apps/tomcat9
    Using CATALINA_TMPDIR: /opt/apps/tomcat9/temp
    Using JRE_HOME:        /opt/apps/jdk1.8.0_181
    Using CLASSPATH:       /opt/apps/tomcat9/bin/bootstrap.jar:/opt/apps/tomcat9-xtservice-app/bin/tomcat-juli.jar
    Using CATALINA_PID:    /opt/apps/tomcat9/bin/CATALINA_PID
    Tomcat did not stop in time.
    To aid diagnostics a thread dump has been written to standard out.
    Killing Tomcat with the PID: 20618
    The Tomcat process has been killed.

  • 相关阅读:
    kafka 项目实战
    7.DHCP的相关命令
    3.centos 7执行service iptables save报错问题
    39.NFS(网络文件系统)
    37.Samba 文件共享服务1--配置共享资源
    36.Samba 文件共享服务1--安装及配置参数解释
    35.简单文件传输协议
    34.vsftpd服务程序--虚拟用户模式
    33.vsftpd服务程序--本地用户模式
    32.vsftpd服务程序--匿名开放模式
  • 原文地址:https://www.cnblogs.com/qingmuchuanqi48/p/12393763.html
Copyright © 2011-2022 走看看