是什么杀死了我的进程?

zjh*_*ner 7 linux kill process redhat-enterprise-linux

一直有应用程序被杀死的问题。这是运行 RHEL5 服务器。我们对进程运行了 strace,在跟踪文件的末尾,我得到了一堆被 SIGKILL +++消息杀死的 +++。SIGKILL 无法被捕获,所以我试图找到一种方法来追踪进程被杀死的原因。

我尝试使用 Red Hat 的一些建议,例如

auditctl -a exit,always -S kill 
Run Code Online (Sandbox Code Playgroud)

这似乎不起作用。我在audit.log 中没有看到任何kill 条目。

Red Hat 的另一个建议是使用 systemtap。我通过 yum 安装它并尝试使用提供的 sigmon.stp 脚本运行 stap。sigmon.stp 在这个页面上:Sigmon.stp 我使用了评论部分提供的命令,这里是输出:

# stap sigmon.stp -x 12647 SIGKILL -v
Pass 1: parsed user script and 85 library script(s) using 146868virt/23716res/3024shr/21404data kb, in 110usr/10sys/116real ms.
semantic error: while resolving probe point: identifier 'kernel' at /usr/share/systemtap/tapset/signal.stp:60:37
        source: probe __signal.send.send_sigqueue = kernel.function("send_sigqueue")
                                                    ^
semantic error: missing x86_64 kernel/module debuginfo under '/lib/modules/2.6.18-308.13.1.el5/build'
semantic error: while resolving probe point: identifier '__signal' at :39:21
        source: probe signal.send = __signal.send.send_sigqueue,
                                    ^
semantic error: no match
semantic error: while resolving probe point: identifier 'signal' at sigmon.stp:30:7
        source: probe signal.send 
                      ^
Pass 2: analyzed script: 1 probe(s), 0 function(s), 0 embed(s), 0 global(s) using 150348virt/28920res/4696shr/24884data kb, in 30usr/40sys/81real ms.
Pass 2: analysis failed.  Try again with another '--vp 01' option.
Missing separate debuginfos, use: debuginfo-install kernel-2.6.18-308.13.1.el5.x86_64  
Run Code Online (Sandbox Code Playgroud)

有没有人使用 stap 命令很幸运?有没有另一种方法可以找出是什么杀死了我的进程?

小智 2

SystemTap 看起来找不到您的内核的调试符号。您是否为正在运行的内核安装了所需的内核调试包?SystemTap 指南说:

要部署 SystemTap,您需要安装 SystemTap 软件包以及适用于您的内核的相应的 -devel、-debuginfo 和 -debuginfo-common 软件包集。如果您的系统安装了多个内核,并且您希望在多个内核上使用 SystemTap,则需要为每个内核版本安装 -devel 和 -debuginfo 软件包。