switch-root: use MS_REC for /run, unless we are soft-rebooting
authorLuca Boccassi <bluca@debian.org>
Sat, 22 Jul 2023 21:45:16 +0000 (22:45 +0100)
committerLuca Boccassi <bluca@debian.org>
Mon, 24 Jul 2023 09:39:14 +0000 (10:39 +0100)
commitb12d41a8bb7c99f7d7a1c7821a886d98b42d9ce0
treea3134b59f82a5442d49bb07c03c23e257b8b59ce
parentacfff02c8ff6a7cff44f1a4b22cf623567124cc1
switch-root: use MS_REC for /run, unless we are soft-rebooting

There are applications that rely on mounts under /run surviving the
switch from initrd to rootfs, so use MS_REC unless we are soft
rebooting.

Follow-up for 7c764d45997721705e43ac66fbb5a56747d00d40

Fixes https://github.com/systemd/systemd/issues/28452
src/core/main.c
src/shared/switch-root.c
src/shared/switch-root.h