[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] init: handle kexec clean reboot
From:       Michael Conrad <mconrad () intellitree ! com>
Date:       2013-05-26 22:09:31
Message-ID: 51A2881B.3070809 () intellitree ! com
[Download RAW message or body]

On 05/22/2013 10:28 PM, Harald Becker wrote:

> To grab Laurent's idea: What about a separate shutdown applet in
> Busybox:
>
> kill(-1,TERM), sleep, kill(-1,KILL), sleep, umount, sync then
> exec into the given remainder of command line? And remove all
> special shutdown processing from init process?
>
> Vor easy shutdown we can do: shutdown poweroff -f
> ... or: shutdown kexec whatever
Since the topic interests people, I figured I'd share a utility I wrote 
recently.  It's designed to be the program that init execs into, and it 
runs a shutdown script with a N second timeout.

https://github.com/silverdirk/failsafe_shutdown

Its purpose is to make sure that the system goes down, and doesn't get 
hung permanently due to unexpected situations.

If the child script doesn't complete, or exits with an unexpected value, 
it does the usual "kill, remount-ro, sync, reboot".  As a convenience, 
it allows the script return value to determine which reboot action is 
called.  (though the script can perform its own reboot call)

Also, does anyone happen to know if there is a way to activate the 
sysrq_trigger actions through a syscall, without needing /proc mounted?

-Mike
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic