java - 进程 killer 识别

标签 java linux jakarta-ee linux-kernel

<分区>

Possible Duplicate:
Who “Killed” my process and why?

我的服务器正在运行一个 java 进程。在日志中我发现我的服务器自动重启(逻辑是如果进程终止,自动启动)。在这里我不知道是谁杀死了我的 java 进程。可能是一些脚本,或者任何东西......不知道。

有什么办法可以找出谁是进程 killer 。

我在 Linux 机器上工作。

最佳答案

尝试 SystemTap :

apt-get install systemtap

将此代码保存到 sigmon.stp 文件中:

# Track when a specific process ID receives a specific signal.  For example,
# when process ID 31994 receives a SIGKILL signal.
#
# Example command line: 
#
#   stap -x 31994 sigmon.stp SIGKILL
#
# Example output: 
#
#   SPID     SNAME            RPID  RNAME            SIGNUM SIGNAME
#   5609     bash             31994 find             9      SIGKILL 
#

probe begin
{
  printf("%-8s %-16s %-5s %-16s %6s %-16s\n",
         "SPID", "SNAME", "RPID", "RNAME", "SIGNUM", "SIGNAME")
}

probe signal.send 
{
  if (sig_name == @1 && sig_pid == target())
    printf("%-8d %-16s %-5d %-16s %-6d %-16s\n", 
      pid(), execname(), sig_pid, pid_name, sig, sig_name)
}

关于java - 进程 killer 识别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13932560/

相关文章:

java - Apache Tomcat 是Web服务器还是应用服务器

java - itext5 在上下文中签署图像

java - 如何仅获取 java 类的 protected 和公共(public)构造函数?

java - Spring REST多个@RequestBody参数,可能吗?

c++ - 在 Linux 上监听 IPv6 多播

linux - 可变日期在 linux cron 中不起作用

java - url 模式和通配符

java - 使用 Java HTTP URL 连接进行暴力破解

c - 在 Linux shell 中通过 ODBC 驱动程序与数据库通信的实用程序

jakarta-ee - 在托管事务期间关闭远程 EJB 连接