Below is what I currently have for this patch. As you sent it in, the
kill(0, SIGTERM) would immediately kill the kernel process along with
everything else, before it can dump core. So, I have the kernel
ignore SIGTERM.
Then, there are still processes which survive. The one case I think I
understand is that a process is handling an infinite sequence of
SIGSEGVs and never sees the SIGTERM. So, I added a loop which waits
for all of the current child processes and kills each one as it
returns some sort of status.
Jeff
--
Work email - jdike at linux dot intel dot com
From: Lepton Wu <ytht.net@gmail.com>
In a stock 2.6.22.6 kernel, poweroff a user mode linux guest
(2.6.22.6 running in skas0 mode) will halt the host linux. I
think the reason is the kernel thread abort because of a bug.
Then the sys_reboot in process of user mode linux guest is
not trapped by the user mode linux kernel and is executed by host.
I think it is better to make sure all of our children process
to quit when user mode linux kernel abort.
[ jdike - the kernel process needs to ignore SIGTERM, plus the
waitpid/kill loop is needed to make sure that all of our children
are dead before the kernel exits ]
Signed-off-by: Lepton Wu <ytht.net@gmail.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
---
arch/um/os-Linux/skas/process.c | 2 +-
arch/um/os-Linux/util.c | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+), 1 deletion(-)
Index: linux-2.6.22/arch/um/os-Linux/util.c
===================================================================
--- linux-2.6.22.orig/arch/um/os-Linux/util.c 2007-09-25 13:33:48.000000000 -0400
+++ linux-2.6.22/arch/um/os-Linux/util.c 2007-09-25 13:45:33.000000000 -0400
@@ -105,6 +105,44 @@ int setjmp_wrapper(void (*proc)(void *,
void os_dump_core(void)
{
+ int pid;
+
signal(SIGSEGV, SIG_DFL);
+
+ /*
+ * We are about to SIGTERM this entire process group to ensure that
+ * nothing i...