Bug 7550 - init: Bad order of shutdown instructions
Summary: init: Bad order of shutdown instructions
Status: RESOLVED WONTFIX
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.22.x
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-18 22:18 UTC by Hut
Modified: 2017-04-07 17:16 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.