diff options
author | NeilBrown <neilb@suse.de> | 2014-04-08 09:22:18 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2014-04-08 09:37:08 +0200 |
commit | 8d1d32bb33da1bd08a398d26f364b84e69ac7b41 (patch) | |
tree | afc391ed07e1659e8ee06905f8044de966a3927c /udev-md-raid-arrays.rules | |
parent | DDF: Don't fail compare_super_ddf due to re-configure changes. (diff) | |
download | mdadm-8d1d32bb33da1bd08a398d26f364b84e69ac7b41.tar.xz mdadm-8d1d32bb33da1bd08a398d26f364b84e69ac7b41.zip |
systemd: various fixes for boot with container-arrays.
1/ Add systemd shutdown script to ensure DDF and IMSM are
clean before we actually shutdown
2/ Get udev to tell systemd to run the mdmon@mdXXX.service
units when a member array appears.
If we boot off a member array (with dracut at least),
the mdmon started in the initramfs will lose track of
/sys etc, so we need to restart it.
systemd will try to forget about it too (but not actually
kill it because we said not to do this).
Having udev tell it to start it will allow a new mdmon to
run which can see /sys, and systemd will know about it.
3/ Always use --offroot and --takeover when starting mdmon with
systemd
--offroot is needed else shutdown will hang.
--takeover is needed incase an mdmon was started earlier
(e.g. in initramfs).
Neither hurt if they aren't actually needed.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'udev-md-raid-arrays.rules')
-rw-r--r-- | udev-md-raid-arrays.rules | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/udev-md-raid-arrays.rules b/udev-md-raid-arrays.rules index 4abbe354..92aec36e 100644 --- a/udev-md-raid-arrays.rules +++ b/udev-md-raid-arrays.rules @@ -34,4 +34,8 @@ ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk ENV{MD_LEVEL}=="raid[1-9]*", ENV{SYSTEMD_WANTS}+="mdmonitor.service" +# Tell systemd to run mdmon for our container, if we need it. +ENV{MD_LEVEL}=="raid[1-9]*", ENV{MD_CONTAINER}=="?*", PROGRAM="/usr/bin/readlink $env{MD_CONTAINER}", ENV{MD_MON_THIS}="%c" +ENV{MD_MON_THIS}=="?*", PROGRAM="/usr/bin/basename $env{MD_MON_THIS}", ENV{SYSTEMD_WANTS}+="mdmon@%c.service" + LABEL="md_end" |