#! /bin/sh /usr/share/dpatch/dpatch-run ## 81_killall_avoid_init.dpatch by Petter Reinholdtsen ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Make sure we do not try to kill init (pid 1) by mistake. Patch ## DP: from SuSe. @DPATCH@ Index: sysvinit/src/killall5.c =================================================================== --- sysvinit/src/killall5.c (revisjon 64) +++ sysvinit/src/killall5.c (arbeidskopi) @@ -605,11 +605,11 @@ exit(1); } - /* Now kill all processes except our session. */ + /* Now kill all processes except init (pid 1) and our session. */ sid = (int)getsid(0); pid = (int)getpid(); for (p = plist; p; p = p->next) - if (p->pid != pid && p->sid != sid && !p->kernel) + if (p->pid != 1 && p->pid != pid && p->sid != sid && !p->kernel) kill(p->pid, sig); /* And let them continue. */