* [PATCH] "Kernel panic - not syncing: Attempted to kill init!" at poweroff/halt
@ 2006-08-16 10:40 Jan Kämpe
2006-09-15 14:44 ` Gerrit Pape
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kämpe @ 2006-08-16 10:40 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 232 bytes --]
Under linux at runit poweroff/halt one might get "kernel panic"
[snip]
- runit: power off...
Shutdown: hda
System halted.
Kernel panic - not syncing: Attempted to kill init!
Workaround for the kernel panic in attached patch ...
[-- Attachment #2: runit.reboot.diff --]
[-- Type: text/x-diff, Size: 632 bytes --]
--- ./src/reboot_system.h2.jk2 2006-06-29 10:53:17.000000000 +0300
+++ ./src/reboot_system.h2 2006-08-16 10:29:16.000000000 +0300
@@ -1,8 +1,20 @@
#include <unistd.h>
#include <sys/reboot.h>
+#include <sys/types.h>
+#include <sys/wait.h>
/* sysdep: +std reboot */
int reboot_system(int what) {
- return(reboot(what));
+ int pid, status;
+ /* fork() before calling reboot since the linux kernel calls do_exit(0) in
+ * kernel/sys.c, which can cause kernel to panic as
+ * the init process would exit ...
+ */
+ if ((pid = fork()) == 0) {
+ reboot(what);
+ _exit(0);
+ }
+ waitpid(pid, &status, 0);
+ return(0);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] "Kernel panic - not syncing: Attempted to kill init!" at poweroff/halt
2006-08-16 10:40 [PATCH] "Kernel panic - not syncing: Attempted to kill init!" at poweroff/halt Jan Kämpe
@ 2006-09-15 14:44 ` Gerrit Pape
0 siblings, 0 replies; 2+ messages in thread
From: Gerrit Pape @ 2006-09-15 14:44 UTC (permalink / raw)
On Wed, Aug 16, 2006 at 01:40:27PM +0300, Jan K?mpe wrote:
> Under linux at runit poweroff/halt one might get "kernel panic"
>
> [snip]
> - runit: power off...
> Shutdown: hda
> System halted.
> Kernel panic - not syncing: Attempted to kill init!
>
> Workaround for the kernel panic in attached patch ...
Thanks, this makes sense. I'll include a fix in the upcoming version.
Regards, Gerrit.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-09-15 14:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-16 10:40 [PATCH] "Kernel panic - not syncing: Attempted to kill init!" at poweroff/halt Jan Kämpe
2006-09-15 14:44 ` Gerrit Pape
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).