init: post kill-all-processes action?

Doug Graham dgraham at nortel.com
Tue Aug 19 17:07:14 UTC 2008


On Tue, Aug 19, 2008 at 05:52:23PM +0200, Bernhard Reutner-Fischer wrote:
> On Tue, Aug 19, 2008 at 11:40:33AM -0400, Doug Graham wrote:
> >So I think it makes sense to allow for an action to be run after all
> >processes have been killed.
> 
> sure.
> http://repo.or.cz/w/buildroot.git?a=blob_plain;f=target/generic/target_busybox_skeleton/etc/inittab;hb=HEAD

Is it guaranteed and/or documented anywhere that the actions run in the
order they appear in inittab?

Also, we don't know ahead of time which processes might be using mounted
filesystems, so I guess we'd have to do a "kill -1".  That might work,
but it seems a bit questionable, since it again raises the possibility
of killing some process that was started as part of running the shutdown
action.  When init itself does the kill -1, it knows that it itself is
the only process that shouldn't be killed, but when a user-specified
action does it, the action doesn't really know which processes were
started by init to run the action.  But maybe it doesn't really matter;
I think this approach should work as long as the order of running the
shutdown actions is guaranteed.

Thanks,
Doug.



More information about the busybox mailing list