mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 13:33:09 +07:00
Simplify shutdown, no need for workarounds to remount / read-only
Calling sync is not needed, remount does this for us. Remount with 'dummydev' causes warnings and is not needed. It appears sysvinit used this to try and fix a sparc related bug. Instead, use the rootfs keyword to ensure we don't accidentally remount a bind mounted /. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -328,11 +328,8 @@ void do_shutdown(shutop_t op)
|
||||
/* ... unmount remaining regular file systems. */
|
||||
unmount_regular();
|
||||
|
||||
/* We sit on / so we must remount it ro, try all the things! */
|
||||
sync();
|
||||
run("mount -n -o remount,ro -t dummytype dummydev /", "mount");
|
||||
run("mount -n -o remount,ro dummydev /", "mount");
|
||||
run("mount -n -o remount,ro /", "mount");
|
||||
/* We sit on / so we must remount it read-only */
|
||||
run("mount -n -o remount,ro -t none rootfs /", "mount");
|
||||
|
||||
/* Call mdadm to mark any RAID array(s) as clean before halting. */
|
||||
mdadm_wait();
|
||||
|
||||
Reference in New Issue
Block a user