通过tomcat的进程id关机(视窗) [英] tomcat shut down through process id (windows)

查看:165
本文介绍了通过tomcat的进程id关机(视窗)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过它的进程ID停止Tomcat进程。我如何使用Java下载Tomcat进程ID?

I want to stop the Tomcat process by its process ID. How can I get the Tomcat process ID using Java?

推荐答案

我不知道如果这有助于为Windows的情况下,但 catalina.sh 脚本可以使用在Linux / UNIX可以告诉存储过程的PID中的一个文件。你只需要在 CATALINA_PID 环境变量设置为您的PID文件的路径名。当你做到了这一点,运行 catalina.sh停止-force 将尝试正常关机,如果失败,将 Tomcat进程。

I'm not sure if this helps for the Windows case, but the catalina.sh script that you can use on Linux / UNIX can be told to store the PID of the process in a file. You just need to set the CATALINA_PID environment variable to the pathname of your PID file. When you've done this, running catalina.sh stop -force will attempt a clean shutdown, and if that fails it will kill the Tomcat process.

这篇关于通过tomcat的进程id关机(视窗)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆