multipath: need_shutdown if multipath devices exist
authorHarald Hoyer <harald@redhat.com>
Fri, 9 Aug 2013 08:44:34 +0000 (10:44 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 9 Aug 2013 08:44:34 +0000 (10:44 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=994913

modules.d/90multipath/module-setup.sh
modules.d/90multipath/multipathd-needshutdown.sh [new file with mode: 0755]

index 6cdc51108888f4928a8fb7602537f1b3613d1518..feb58dcd3c851816eb0ef80f60d968115f4f9cad 100755 (executable)
@@ -95,6 +95,9 @@ install() {
         inst_hook pre-trigger 02 "$moddir/multipathd.sh"
         inst_hook cleanup   02 "$moddir/multipathd-stop.sh"
     fi
+
+    inst_hook cleanup   80 "$moddir/multipathd-needshutdown.sh"
+
     inst_rules 40-multipath.rules 62-multipath.rules 65-multipath.rules 66-kpartx.rules
 }
 
diff --git a/modules.d/90multipath/multipathd-needshutdown.sh b/modules.d/90multipath/multipathd-needshutdown.sh
new file mode 100755 (executable)
index 0000000..1565d4d
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+for i in /dev/mapper/mpath*; do
+    [ -b "$i" ] || continue
+    need_shutdown
+    break
+done