Is there a way to find out the origin of a signal sent in Red Hat Enterprise Linux 5 (SIGTERM etc.)? I'm regularly trapping a TERM in an application and I have no idea where it is coming from.
The man page for
From the man page:
The sigaction structure is defined as something like:
On platforms with DTrace (OS X, Solaris, …others?) you can use it with a probe like this to log the information you're after:
I based this on a script found at the bottom of http://www.brendangregg.com/DTrace/dtrace_oneliners.txt plus some additional "relevant variable names" tips at http://stackoverflow.com/a/10465606/179583, and seems to work under some basic testing. Now, if only my process would unexpectedly die again! ;-)