I have a series of scripts that are being killed ($?
says exit code is 137, which implies a kill -9
scenario). I need to know what process killed them. Is there a way to find out this information?
Asked
Active
Viewed 3,471 times
0

Glen Solsberry
- 1,536
- 5
- 28
- 38
2 Answers
1
I don't believe that there's any way to retrieve the pid of the process that sends the kill, at least from within another process. The signal is sent via a kernel interrupt, and as far as I know, it's only the kernel that knows which process sent it.
That being said, if you're comfortable with patching the kernel to find this out, you might take a look at this: patching the kernel to log signals

malcolmpdx
- 2,300
- 1
- 16
- 12
0
Exit code 137 references a time out signal.
Read this page on exit codes and signals
I'd also suggest looking for the OOM issue in the /var/log/messages folder.

Split71
- 548
- 4
- 9
-
From your link: `... exit code 137 means that the job received a signal 9 ...`; this is not a time out signal. – Glen Solsberry Mar 28 '11 at 15:49
-
forgive me that was under the hypernews section. Have you checked out the /var/log/messages ? – Split71 Mar 28 '11 at 16:58
-
Yes, and regarding any kills, it is empty. – Glen Solsberry Mar 28 '11 at 17:25