is there any way to trace a system signal to it's generator?

Nov 23, 2011 at 4:59am
Hi all,

I'm having some problem with my app on Debian Lenny system. I have 16 instances running and one or two of them may receive a SIGTERM signal somewhere from the system.

I'm wondering if there is a way of tracing the signal to it's originator so I can see where it's coming from?

Thanks.
Nov 23, 2011 at 7:53am
IIRC if you have your app register for SIGTERM via sigaction() instead of signal(), the struct siginfo_t that you get contains enough information to tell you the originating PID.
Nov 23, 2011 at 3:23pm
Thanks jsmith. I was using signal() and am switching to sigaction() as we speak.

Just out of curiosity, is there any way to trace that while using signal()?
Nov 23, 2011 at 10:21pm
No, there isn't.

signal() is actually a deprecated function in favor of sigaction().
Topic archived. No new replies allowed.