init: post kill-all-processes action?

Denys Vlasenko vda.linux at googlemail.com
Wed Aug 20 00:53:13 UTC 2008


On Tuesday 19 August 2008 17:40, Doug Graham wrote:
> Should init have the ability to run actions after killing all processes?
> As it stands now, the "shutdown" action is run just before killing all
> processes in kill_all_processes().  We'd like to be able to cleanly unmount
> all filesystems as part of shutting down, so that no fsck is required
> on the next boot.  However, the filesystems can only be unmounted after
> all processes have been killed.
> 
> We could try doing this by having our shutdown action kill all processes
> before doing the unmount, but this could be tricky.  The "kill -1"
> might kill some process that we don't want killed, such as the shell
> process that is launched to run the shutdown action.
> 
> So I think it makes sense to allow for an action to be run after all
> processes have been killed.  Thoughts?

I don't use init at all (my init is a shell script).

I shut down my machine basically with sequence of
sync, killall5 -TERM, umount -a, killall5 -KILL
wiht some sleeps inserted in between.

Works like a charm.
--
vda



More information about the busybox mailing list