diff options
author | NeilBrown <neilb@suse.de> | 2023-03-13 04:42:58 +0100 |
---|---|---|
committer | Jes Sorensen <jes@trained-monkey.org> | 2023-03-19 17:33:25 +0100 |
commit | 723d1df4946eb40337bf494f9b2549500c1399b2 (patch) | |
tree | c28a33058108fecc8c14f6f75c7bc820f8970d32 /systemd | |
parent | mdmon: Remove need for KillMode=none (diff) | |
download | mdadm-723d1df4946eb40337bf494f9b2549500c1399b2.tar.xz mdadm-723d1df4946eb40337bf494f9b2549500c1399b2.zip |
mdmon: Improve switchroot interactions.
We need a new mdmon@mdfoo instance to run in the root filesystem after
switch root, as /sys and /dev are removed from the initrd.
systemd will not start a new unit with the same name running while the
old unit is still active, and we want the two mdmon processes to overlap
in time to avoid any risk of deadlock, which can happen when a write is
attempted with no mdmon running.
So we need a different unit name in the initrd than in the root. Apart
from the name, everything else should be the same.
This is easily achieved using a different instance name as the
mdmon@.service unit file already supports multiple instances (for
different arrays).
So start "mdmon@mdfoo.service" from root, but
"mdmon@initrd-mdfoo.service" from the initrd. udev can tell which
circumstance is the case by looking for /etc/initrd-release.
continue_from_systemd() is enhanced so that the "initrd-" prefix can be
requested.
Teach mdmon that a container name like "initrd/foo" should be treated
just like "foo". Note that systemd passes the instance name
"initrd-foo" as "initrd/foo".
We don't need a similar mechanism at shutdown because dracut runs
"mdmon --takeover --all" when appropriate.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
Diffstat (limited to 'systemd')
-rw-r--r-- | systemd/mdmon@.service | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/systemd/mdmon@.service b/systemd/mdmon@.service index 303ad05c..23a375f6 100644 --- a/systemd/mdmon@.service +++ b/systemd/mdmon@.service @@ -6,7 +6,7 @@ # (at your option) any later version. [Unit] -Description=MD Metadata Monitor on /dev/%I +Description=MD Metadata Monitor on %I DefaultDependencies=no Before=initrd-switch-root.target Documentation=man:mdmon(8) |