diff mbox

multipath-tools/multipath mpath_wait multipath ...

Message ID 20100823220659.26161.qmail@sourceware.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

bmarzins@sourceware.org Aug. 23, 2010, 10:06 p.m. UTC
None
diff mbox

Patch

--- multipath-tools/multipath/mpath_wait	2006/10/06 16:38:01	1.1
+++ multipath-tools/multipath/mpath_wait	2010/08/23 22:06:58	1.1.2.1
@@ -3,6 +3,18 @@ 
 retry=3
 sec=1
 
+if  [ $# -eq 1 ]
+then
+	while [ ! -e $1 -a "$retry" -gt 0 ]
+	do
+		retry=$(($retry - 1))
+		sleep $sec
+	done
+	[ -e $1 ]
+	ret=$?
+	exit $ret
+fi
+
 /sbin/dmsetup info -c --noheadings -j $1 -m $2 2> /dev/null | grep -q .*:${1}:${2}:L.*:.*:.*:.*:.*
 ret=$?
 
--- multipath-tools/multipath/multipath.rules	2009/09/29 17:52:27	1.11.2.2
+++ multipath-tools/multipath/multipath.rules	2010/08/23 22:06:58	1.11.2.3
@@ -6,7 +6,7 @@ 
 PROGRAM!="/sbin/mpath_wait %M %m", GOTO="end_mpath"
 PROGRAM!="/sbin/dmsetup info -c --noheadings -j %M -m %m", GOTO="end_mpath"
 RESULT!="*:*:*:*:*:*:*:mpath-*", GOTO="kpartx_check"
-PROGRAM=="/sbin/dmsetup info -c --noheadings -o name -j %M -m %m", RESULT=="?*", NAME="%k", SYMLINK="mpath/%c", RUN+="/sbin/kpartx -a -p p /dev/mapper/%c"
+PROGRAM=="/sbin/dmsetup info -c --noheadings -o name -j %M -m %m", RESULT=="?*", NAME="%k", SYMLINK="mpath/%c", RUN+="/bin/bash -c '/sbin/mpath_wait /dev/mapper/%c; /sbin/kpartx -a -p p /dev/mapper/%c'"
 OPTIONS="last_rule"
 LABEL="kpartx_check"
 RESULT!="*:*:*:*:*:*:*:part*-mpath-*", GOTO="end_mpath"