diff options
author | NeilBrown <neilb@suse.de> | 2013-12-02 06:08:04 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-12-02 06:08:04 +0100 |
commit | 169ffac7ad7748c8586fd1d68b7a417d71133140 (patch) | |
tree | a803ecce4c74572e72724e84ca692824732672fb /udev-md-raid-assembly.rules | |
parent | Incremental: add --export handling. (diff) | |
download | mdadm-169ffac7ad7748c8586fd1d68b7a417d71133140.tar.xz mdadm-169ffac7ad7748c8586fd1d68b7a417d71133140.zip |
Systemd integration for starting newly-degraded arrays.
Normally "mdadm -I" will not start an array if it has reason to
expect further devices.
This means that if a device is removed while the host is shut down,
"mdadm -I" will never start the device.
If the array is know to the host, it make sense to start the array
anyway after a reasonable timeout.
This patch adds systemd/udev infrastructure so that 30 seconds after
a known array first becomes able to be assembled as a degraded array,
the array will be assembled even if more devices are still expected.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'udev-md-raid-assembly.rules')
-rw-r--r-- | udev-md-raid-assembly.rules | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/udev-md-raid-assembly.rules b/udev-md-raid-assembly.rules index b6532658..72bbed4d 100644 --- a/udev-md-raid-assembly.rules +++ b/udev-md-raid-assembly.rules @@ -12,7 +12,8 @@ LABEL="md_inc" # remember you can limit what gets auto/incrementally assembled by # mdadm.conf(5)'s 'AUTO' and selectively whitelist using 'ARRAY' -ACTION=="add", RUN+="/sbin/mdadm --incremental $devnode --offroot" +ACTION=="add", IMPORT{program}="/sbin/mdadm --incremental --export $devnode --offroot" +ACTION=="add", ENV{MD_STARTED}=="*unsafe*", ENV{MD_FOREIGN}=="no", ENV{SYSTEMD_WANTS}+="mdadm-last-resort@$env{MD_DEVICE}.timer" ACTION=="remove", ENV{ID_PATH}=="?*", RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}" ACTION=="remove", ENV{ID_PATH}!="?*", RUN+="/sbin/mdadm -If $name" |