https://access.redhat.com/solutions/360993
SOLUTION 已验证 - 已更新 2017年七月19日09:14 -
环境
- Red Hat Enterprise Linux (RHEL) 7
- Red Hat Enterprise Linux (RHEL) 6
- Red Hat Enterprise Linux (RHEL) 5
问题
- System is getting rebooted automatically, some process is sending 'SIGTERM' signal.
- How do I find out who sent a 'SIGTERM/Signal-15'?
决议
The following systemtap script can find out who sent the Signal-15:
- Let's try the following:
#!/usr/bin/env stap
probe signal.send {
if (pid_name == @1) {
if (sig_name == "SIGTERM") {
printf("%s(pid: %d) received a %s signal sent by %s(%d)\n", pid_name, sig_pid, sig_name, execname(), pid())
exit()
}
}
}
- Example:
$ stap sigcheck.stp sshd
sshd(pid: 34469) received a SIGTERM signal sent by bash(31815)
-
Please ensure the correct execname of the process is specified
-
For more info about SystemTap script please refer to the documentation.

博客围绕Red Hat Enterprise Linux(RHEL)5、6、7系统展开。系统存在自动重启问题,有进程发送'SIGTERM'信号。提出的决议是使用SystemTap脚本找出发送'Signal - 15'的进程,同时要确保指定进程的正确执行名称,更多脚本信息可参考文档。
4066

被折叠的 条评论
为什么被折叠?



