]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] SAK messages
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 22 Apr 2002 06:12:00 +0000 (23:12 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 22 Apr 2002 06:12:00 +0000 (23:12 -0700)
vda@port.imtp.ilyichevsk.odessa.ua: SAK messages:
  I use SAK from time to time when I have problems with hung processes.

  Sometimes it is difficult to figure out what was being killed and why.

  For example, Midnight Commander contains a bug: it holds fd#3 open to
  the tty. It prevented me from daemonizing processes (like X) - they
  died upon SAK.

  This little patch makes SAK tell whom and why it kills. Tested.

(Included in 2.4)

drivers/char/tty_io.c

index d77cfdb24515f2379237c9d2b5ef142711522652..f0321a828f5f3cf19993847b2884b6559ba706b9 100644 (file)
@@ -1835,6 +1835,9 @@ static void __do_SAK(void *arg)
        for_each_task(p) {
                if ((p->tty == tty) ||
                    ((session > 0) && (p->session == session))) {
+                       printk(KERN_NOTICE "SAK: killed process %d"
+                           " (%s): p->session==tty->session\n",
+                           p->pid, p->comm);
                        send_sig(SIGKILL, p, 1);
                        continue;
                }
@@ -1845,6 +1848,9 @@ static void __do_SAK(void *arg)
                                filp = fcheck_files(p->files, i);
                                if (filp && (filp->f_op == &tty_fops) &&
                                    (filp->private_data == tty)) {
+                                       printk(KERN_NOTICE "SAK: killed process %d"
+                                           " (%s): fd#%d opened to the tty\n",
+                                           p->pid, p->comm, i);
                                        send_sig(SIGKILL, p, 1);
                                        break;
                                }