【问题标题】:Process Killer identification [duplicate]进程杀手识别[重复]
【发布时间】:2012-12-05 15:14:24
【问题描述】:

可能重复:
Who “Killed” my process and why?

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

有没有办法找出谁是进程杀手。

我正在使用 Linux 机器。

【问题讨论】:

标签: java linux jakarta-ee linux-kernel


【解决方案1】:

试试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)
}

【讨论】:

    猜你喜欢
    • 2011-02-12
    • 1970-01-01
    • 2020-05-26
    • 2013-05-26
    • 1970-01-01
    • 1970-01-01
    • 2021-01-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多