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
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to