90multipath: add shutdown script

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>
master
Hannes Reinecke 2016-08-25 09:33:26 +02:00 committed by Daniel Molkentin
parent 8d20322f11
commit 239e8ba2ac
3 changed files with 13 additions and 4 deletions

View File

@ -89,6 +89,7 @@ install() {
fi fi


inst_hook cleanup 80 "$moddir/multipathd-needshutdown.sh" inst_hook cleanup 80 "$moddir/multipathd-needshutdown.sh"
inst_hook shutdown 20 "$moddir/multipath-shutdown.sh"


inst_rules 40-multipath.rules 56-multipath.rules \ inst_rules 40-multipath.rules 56-multipath.rules \
62-multipath.rules 65-multipath.rules \ 62-multipath.rules 65-multipath.rules \

View File

@ -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

View File

@ -1,7 +1,8 @@
#!/bin/sh #!/bin/sh


for i in /dev/mapper/mpath*; do for i in $(multipath -l -v1); do
[ -b "$i" ] || continue if $(dmsetup table $i | sed -n '/.*queue_if_no_path.*/q1') ; then
need_shutdown need_shutdown
break break
fi
done done