[BusyBox] Rebooting the system?

Uwe Beutin uwe at imbrium.de
Tue Nov 19 02:56:03 UTC 2002


On Tue, 19 Nov 2002, Michael Boman wrote:

> I am trying to get BusyBox's 'reboot' command just to plainly reboot the
> system (very much as the small button on the front panel does). I have
> a small /bin/ash script that does a custom hands-off installation of
> Linux and I would like it to just reboot the system once done. Everytime
> I try to execute the reboot command I get "Kernel panic: Attempted to
> kill init!". Could anyone give me a clue about this matter?

Hmm, I haven't had any success with the busybox reboot on my 
controller, either. I think it is the

kill(-1, SIGKILL);

which causes the trouble, but I am not sure, why. I have modified the 
reboot.c for myself to simply do the following, and this works, at least 
for me:

/* Do umounts, delays, etc... */

kill(1, SIGTSTP);
sync();
signal(SIGTERM,SIG_IGN);
signal(SIGHUP,SIG_IGN);
setpgrp();
kill(-1, SIGTERM);
sleep(1);
kill(-1, SIGHUP);
sleep(1);
sync();
sleep(1);
reboot(RB_AUTOBOOT);

Cheers,

	Uwe




More information about the busybox mailing list