Hi,

The monitor operation of  iSCSILogicalUnit  is not specific enough in the 
regular expression and I got very "nice" fencing going because it was falsely 
reporting "failed to stop" resource.

I happened to add primitive lun-build10, while already having lun-build1.

For myself I have narrowed it down to the following fix, but probably a more 
appropriate regex has to be applied to these and other commands serving the 
same purpose for other iSCSI implementations.

diff --git a/heartbeat/iSCSILogicalUnit b/heartbeat/iSCSILogicalUnit
index 25ee32e..2cee970 100755
--- a/heartbeat/iSCSILogicalUnit
+++ b/heartbeat/iSCSILogicalUnit
@@ -328,7 +328,7 @@ iSCSILogicalUnit_monitor() {
        tgt)
            # Figure out and set the target ID
            TID=`tgtadm --lld iscsi --op show --mode target \
-               | sed -ne "s/^Target \([[:digit:]]\+\): 
${OCF_RESKEY_target_iqn}/\1/p"`
+               | sed -ne "s/^Target \([[:digit:]]\+\): 
${OCF_RESKEY_target_iqn}$/\1/p"`
            if [ -z "$TID" ]; then
                # Our target is not configured, thus we're not
                # running.
@@ -337,7 +337,7 @@ iSCSILogicalUnit_monitor() {
            # This only looks for the backing store, but does not test
            # for the correct target ID and LUN.
            tgtadm --lld iscsi --op show --mode target \
-               | grep -E -q "[[:space:]]+Backing store.*: ${OCF_RESKEY_path}" 
&& return $OCF_SUCCESS
+               | grep -E -q "[[:space:]]+Backing store.*: ${OCF_RESKEY_path}$" 
&& return $OCF_SUCCESS
            ;;
        lio)
            
configfs_path="/sys/kernel/config/target/iscsi/${OCF_RESKEY_target_iqn}/tpgt_1/lun/lun_${OCF_RESKEY_lun}/${OCF_RESOURCE_INSTANCE}/udev_path"
 

Regards,
Vadym Chepkov

_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to