[PATCH 4/5] don't panic if /sbin/init exits or killed

From: Oleg Nesterov
Date: Sun Mar 16 2008 - 11:51:30 EST


If the buggy init exits, the kernel panics. I see no point for this. It is very
possible that the system is still usable enough, at least to read the logs and
prepare the bug report.

Change exit_child_reaper() to do BUG() instead of panic().

Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>

--- 25/kernel/exit.c~4_EXIT_DONT_PANIC 2008-03-16 16:49:30.000000000 +0300
+++ 25/kernel/exit.c 2008-03-16 16:49:35.000000000 +0300
@@ -861,8 +861,10 @@ static inline void exit_child_reaper(str
if (likely(tsk->group_leader != task_child_reaper(tsk)))
return;

- if (tsk->nsproxy->pid_ns == &init_pid_ns)
- panic("Attempted to kill init!");
+ if (unlikely(tsk->nsproxy->pid_ns == &init_pid_ns)) {
+ printk(KERN_EMERG "Kernel panic - init is killed!\n");
+ BUG();
+ }

/*
* @tsk is the last thread in the 'cgroup-init' and is exiting.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/