danielhilst

print-kills-on-console

Feb 19th, 2013
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. On Mon, 18 Feb 2013 15:46:58 -0300, "Daniel." said:
  2. > Is there a way to track signals, specially SIGKILL. I would like to
  3. > know if some process dies because reach some resource limit, because
  4. > an OMM error or something likewise..
  5.  
  6. Depends on where you want the tracking to go. But your first thing to try
  7. would probably be:
  8.  
  9. echo 1 > /proc/sys/kernel/print-fatal-signals
  10.  
  11. which controls this code in kernel/signal.c:
  12.  
  13. static void print_fatal_signal(int signr)
  14. {
  15. struct pt_regs *regs = signal_pt_regs();
  16. printk("%s/%d: potentially unexpected fatal signal %d.\n",
  17. current->comm, task_pid_nr(current), signr);
  18.  
  19. Bahh. That's missing a KERN_INFO. Patch submitted.
Advertisement
Add Comment
Please, Sign In to add comment