Bug 7550

Summary: init: Bad order of shutdown instructions
Product: Busybox Reporter: Hut <public>
Component: OtherAssignee: unassigned
Status: RESOLVED WONTFIX    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.22.x   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

Description Hut 2014-10-18 22:18:56 UTC
Currently the order of shutdown instructions in the run_shutdown_and_kill_processes function in init/init.c [1] is broken:

1. the inittab actions for the action type "shutdown" are run
2. all the programs are killed

One of the default inittab instructions for shutting down is "umount -a -r".  However, since it's executed before the programs are killed, it can not properly unmount some of the file systems because there may be programs still accessing them.  This leaves those file systems in an unclean state after shutting down.

I don't know if simply changing the order would be a sensible way to deal with this issue though, as they may be scripts depending on this order.

[1] http://git.busybox.net/busybox/tree/init/init.c?id=760d035699c4a878f9109544c1d35ea0d5f6b76c#n735
Comment 1 Denys Vlasenko 2017-04-07 17:16:03 UTC
Won't be fixing it.
Supply your own "shutdown" actions in your inittab.