我正在使用tomcat,有时当我告诉它停止时,它并不能正常终止进程。
我的解决方法也是:
lsof -i tcp:8080
输出:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 888 root 35u IPv6 780659 0t0 TCP *:http-alt (LISTEN)
java 888 root 39r IPv6 790103 0t0 TCP localhost:58916->localhost:http-alt (CLOSE_WAIT)
java 888 root 40r IPv6 792585 0t0 TCP localhost:58936->localhost:http-alt (CLOSE_WAIT)
java 888 root 75r IPv6 785553 0t0 TCP localhost:58701->localhost:http-alt (CLOSE_WAIT)
java 888 root 77r IPv6 787642 0t0 TCP localhost:58814->localhost:http-alt (CLOSE_WAIT)
java 888 root 130u IPv6 783894 0t0 TCP localhost:58686->localhost:http-alt (CLOSE_WAIT)
java 888 root 353u IPv6 780929 0t0 TCP localhost:58632->localhost:http-alt (CLOSE_WAIT)
然后我跑
kill -9 pid
我想要一种获取所有pid编号并杀死它们的方法。我不知道如何隔离该领域。
tomcat
打开一个进程,则可以使用killall -9 tomcat