Linux - 如何找到谁将sigterm信号发送到我的进程 [英] Linux - how to find who send the sigterm signal to my process

查看:672
本文介绍了Linux - 如何找到谁将sigterm信号发送到我的进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的进程收到SIGTERM信号,我使用API​​ sigaction来获取发件人。

但系统中不存在发件人(在我获得其pid之后)。似乎发件人退出发送信号后。

我想知道谁是发件人,为什么它会向我发送SIGTERM。



什么我试过了:



过程很大,strace不起作用。

my process receive a SIGTERM signal, I used the API sigaction to get the sender.
But the sender is not exist in the system(after I got its pid).It seems the sender exit after sending the signal.
I want to know who is the sender, why it send a SIGTERM to me.

What I have tried:

The process is big, strace will not work.

推荐答案

如果进程已终止,PID将从进程表中删除,您将无法获得有关该进程的任何信息。



如果您想要调查哪个进程正在杀死您的进程,您可以使用进程监视工具来记录使用其PID启动和停止的所有进程。考生可能是 pidstat(1):报告任务统计信息 - Linux手册页 [ ^ ], psacct / acct sar
If a process has been terminated the PID is removed from the process table and you won't be able to get any informartion about the process.

If you want to investigate which process is killing yours, you can use a process monitoring tool that logs all processes that are started and stopped with their PID. Candidates might be pidstat(1): Report statistics for tasks - Linux man page[^], psacct / acct and sar.


这篇关于Linux - 如何找到谁将sigterm信号发送到我的进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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