how to reboot but leave same kernel (tell pid 1 to run /linuxrc again)?

Frantisek Dufka dufkaf at gmail.com
Wed Nov 21 16:51:38 UTC 2007


Luciano Rocha wrote:
> In inittab, add something like:
> ::restart:/sbin/init
> 
> Then kill init with signal QUIT:
> kill -QUIT 1
> 
> Then init will execute the program at /sbin/init, that can be a symlink
> to /linuxrc in your mtdblock3, or change the inittab directoy.
> 

Thanks but isn't this used and meant for something else (like when init 
restarts itself on upgrade) so this may actually happen and should be 
left alone pointing to real init? Also renaming init may leave the 
system in unbootable state when booted later in normal way. But still 
thanks, good idea, maybe this could work after all. True that such fake 
/sbin/init script could be left there all the time and exec the real one 
for all normal runlevels except the 'fake reboot' situation I want. I'll 
try it.

Also I want to apologize, I had my facts wrong, 770 rootfs uses busybox 
for almost anything basic except /sbin/init which is in fact 
sysvinit-2.85. I don't know why I was sure it uses busybox init. But 
there is similar re-exec way via 'init U' so this solution could be 
applied too. Thanks.

Frantisek



More information about the busybox mailing list