ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 强制关闭tomcat sh脚本

强制关闭tomcat sh脚本

Linux操作系统 作者:dxm2025 时间:2014-11-20 10:19:42 0 删除 编辑

shutdown-force.sh解决tomcat无法正常关闭需要手动kill问题。

把shutdown-force.sh放到tomcat/bin目录下,强制关闭tomcat:

cd tomcat/bin
./shutdown-force.sh

sh脚本内容:

set fileformat=unix
#!/bin/bash
#by lym6520 2014-11-08
#force shutdown tomcat,copy this sh file to tomcat/bin dir

path=${PWD}

ps -ef|grep $path|grep java|awk '{print $2}'

echo "exec $path/shutdown.sh"
$path/shutdown.sh

sleep 3s

#kill -9 pid
ps -ef|grep $path|grep java|awk '{print $2}'|xargs kill -9

#success msg
echo "shutdown success"

ps -ef|grep $path|grep java|awk '{print $2}'

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30015039/viewspace-1339906/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-11-09

  • 博文量
    169
  • 访问量
    233177