且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Linux - 如何找到谁将sigterm信号发送到我的进程

更新时间:2023-11-27 14:51:52

如果进程已终止,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.