From c8c5e4e88a410b96241694be89ac10c77659e498 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Tue, 12 Apr 2022 22:22:18 +0200 Subject: [PATCH] Revert "Simplify shutdown, no need for workarounds to remount / read-only" This reverts commit 7c42986800d00ec84b3ea4c11f0e99790f9364cb since we seem to still need this werid thing on some systems. The key seems to use 'any' device at remount[1]. Anyway, the key issue before was the noisy output, but like Debian we'll just redirect to /dev/null. [1]: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/29187 Signed-off-by: Joachim Wiberg --- src/sig.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sig.c b/src/sig.c index 3df0aabe..4ddfc29b 100644 --- a/src/sig.c +++ b/src/sig.c @@ -328,8 +328,11 @@ void do_shutdown(shutop_t op) /* ... unmount remaining regular file systems. */ unmount_regular(); - /* We sit on / so we must remount it read-only */ - run("mount -n -o remount,ro -t none rootfs /", "mount"); + /* 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"); /* Call mdadm to mark any RAID array(s) as clean before halting. */ mdadm_wait();