]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
90multipath: add shutdown script
authorHannes Reinecke <hare@suse.de>
Thu, 25 Aug 2016 07:33:26 +0000 (09:33 +0200)
committerDaniel Molkentin <dmolkentin@suse.com>
Fri, 15 Dec 2017 19:42:15 +0000 (20:42 +0100)
As the device-mapper module is removing all device-mapper tables
during shutdown we need to make sure to disable queuing on the
multipath devices; otherwise there might still be I/O pending
and the removal will fail.

References: bsc#994860

Signed-off-by: Hannes Reinecke <hare@suse.com>
modules.d/90multipath/module-setup.sh
modules.d/90multipath/multipath-shutdown.sh [new file with mode: 0755]
modules.d/90multipath/multipathd-needshutdown.sh

index 0a680b177b376ebbfa2f4bdbd0d3a1994e4183d7..983f6f240d77b4272b425739ea1b9a42a66be0e3 100755 (executable)
@@ -89,6 +89,7 @@ install() {
     fi
 
     inst_hook cleanup   80 "$moddir/multipathd-needshutdown.sh"
+    inst_hook shutdown  20 "$moddir/multipath-shutdown.sh"
 
     inst_rules 40-multipath.rules 56-multipath.rules \
        62-multipath.rules 65-multipath.rules \
diff --git a/modules.d/90multipath/multipath-shutdown.sh b/modules.d/90multipath/multipath-shutdown.sh
new file mode 100755 (executable)
index 0000000..47e9990
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+for i in $(multipath -l -v1); do
+    if ! $(dmsetup table $i | sed -n '/.*queue_if_no_path.*/q1') ; then
+        dmsetup message $i 0 fail_if_no_path
+    fi
+done
index 214abd3af198dc52d846d583543d2a795fe7b058..ee9b69b4f3c2075250354b367ef0d40cf21e4857 100755 (executable)
@@ -1,7 +1,8 @@
 #!/bin/sh
 
-for i in /dev/mapper/mpath*; do
-    [ -b "$i" ] || continue
-    need_shutdown
-    break
+for i in $(multipath -l -v1); do
+    if $(dmsetup table $i | sed -n '/.*queue_if_no_path.*/q1') ; then
+        need_shutdown
+        break
+    fi
 done