mirror of
https://github.com/troglobit/finit.git
synced 2026-11-03 13:28:27 +00: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:
1 parent
6f802a7ff1
commit
7c42986800
1 file changed
+2
-5
@@ -328,11 +328,8 @@ void do_shutdown(shutop_t op)
|
|||||||
/* ... unmount remaining regular file systems. */
|
/* ... unmount remaining regular file systems. */
|
||||||
unmount_regular();
|
unmount_regular();
|
||||||
|
|
||||||
/* We sit on / so we must remount it ro, try all the things! */
|
/* We sit on / so we must remount it read-only */
|
||||||
sync();
|
run("mount -n -o remount,ro -t none rootfs /", "mount");
|
||||||
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");
|
|
||||||
|
|
||||||
/* Call mdadm to mark any RAID array(s) as clean before halting. */
|
/* Call mdadm to mark any RAID array(s) as clean before halting. */
|
||||||
mdadm_wait();
|
mdadm_wait();
|
||||||
|
|||||||
Reference in new issue
Block a user