summaryrefslogtreecommitdiffstats
path: root/src/shutdown/shutdown.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-08-02 21:19:14 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-08-03 20:58:10 +0200
commit6b219b74de53729249956221a971047aab7c96e0 (patch)
treeacbf4de6edea4cc1af7b74021904f049aabcb81a /src/shutdown/shutdown.c
parentshutdown: disable recursive mount of /run/ on switching root (diff)
downloadsystemd-6b219b74de53729249956221a971047aab7c96e0.tar.xz
systemd-6b219b74de53729249956221a971047aab7c96e0.zip
shutdown: do not umount recursively before MS_MOVE
Unmounting filesystem will be done gracefully by shutdown itself. Follow-up for f2c1d491a539035d6cc1fa53a7cef0cbc8d52902 and 268d1244e87a35ff8dff56c92ef375ebf69d462e.
Diffstat (limited to '')
-rw-r--r--src/shutdown/shutdown.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c
index 97a4050ae9..ed873c61f1 100644
--- a/src/shutdown/shutdown.c
+++ b/src/shutdown/shutdown.c
@@ -168,12 +168,13 @@ static int switch_root_initramfs(void) {
* Disable sync() during switch-root, we after all sync'ed here plenty, and a dumb sync (as opposed
* to the "smart" sync() we did here that looks at progress parameters) would defeat much of our
* efforts here. As the new root will be /run/initramfs/, it is not necessary to mount /run/
- * recursively. */
+ * recursively. Also, do not umount filesystems before MS_MOVE, as that should be done by ourself. */
return switch_root(
/* new_root= */ "/run/initramfs",
/* old_root_after= */ "/oldroot",
/* flags= */ SWITCH_ROOT_DONT_SYNC |
- SWITCH_ROOT_SKIP_RECURSIVE_RUN);
+ SWITCH_ROOT_SKIP_RECURSIVE_RUN |
+ SWITCH_ROOT_SKIP_RECURSIVE_UMOUNT);
}
/* Read the following fields from /proc/meminfo: