Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > media > main-src > by-pkgid > e536fc0c6270ec1d92a0fd41bb1f8360 > files > 40

rgmanager-2.0.52-28.el5_8.2.src.rpm

From 7c7b9e3c6e7f2a41376ce04d2cfc3c0d88840494 Mon Sep 17 00:00:00 2001
From: Lon Hohberger <lhh@redhat.com>
Date: Tue, 31 Mar 2009 14:57:15 -0400
Subject: [PATCH] rgmanager: Fix monitor_link="0" starts

If link monitoring is disabled, still allow starting
of the IP resource.

rhbz#532756

Signed-off-by: Lon Hohberger <lhh@redhat.com>
---
 rgmanager/src/resources/ip.sh |   36 +++++++++++++++++++-----------------
 1 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/rgmanager/src/resources/ip.sh b/rgmanager/src/resources/ip.sh
index d9bc517..e9779a2 100755
--- a/rgmanager/src/resources/ip.sh
+++ b/rgmanager/src/resources/ip.sh
@@ -564,10 +564,14 @@ ipv6()
                         if [ $? -ne 0 ]; then
                                 continue
                         fi
-                        network_link_up $dev
-                        if [ $? -ne 0 ]; then
-                                continue
-                        fi
+
+			if [ "$OCF_RESKEY_monitor_link" = "yes" ]; then
+				network_link_up $dev
+				if [ $? -ne 0 ]; then
+					continue
+				fi
+			fi
+
 			if [ "${addr/\/*/}" = "${addr}" ]; then
 				addr="$addr/$maskbits"
 			fi
@@ -633,9 +637,11 @@ ipv4()
 			if [ $? -ne 0 ]; then
 			        continue
 			fi
-			network_link_up $dev
-			if [ $? -ne 0 ]; then
-				continue
+			if [ "$OCF_RESKEY_monitor_link" = "yes" ]; then
+				network_link_up $dev
+				if [ $? -ne 0 ]; then
+					continue
+				fi
 			fi
 
 			if [ "${addr/\/*/}" = "${addr}" ]; then
@@ -751,15 +757,9 @@ ip_op()
 {
 	declare dev
 	declare rtr
-	declare monitor_link
 	declare addr=${3/\/*/}
 	
-	monitor_link="yes"
-	if [ "${OCF_RESKEY_monitor_link}" = "no" ] ||
-	    [ "${OCF_RESKEY_monitor_link}" = "0" ]; then
-	        monitor_link="no"
-	fi
-	
+
 	if [ "$2" = "status" ]; then
 
 		ocf_log debug "Checking $3, Level $OCF_CHECK_LEVEL"
@@ -771,7 +771,7 @@ ip_op()
 		fi
 		ocf_log debug "$3 present on $dev"
 		
-		if [ "$monitor_link" = "yes" ]; then
+		if [ "$OCF_RESKEY_monitor_link" = "yes" ]; then
 			if ! network_link_up $dev; then
 		        	ocf_log warn "No link on $dev..."
 				return 1
@@ -822,11 +822,13 @@ if [ -z "$OCF_CHECK_LEVEL" ]; then
 	OCF_CHECK_LEVEL=0
 fi
 
-if [ -z "$OCF_RESKEY_monitor_link" ]; then
+if [ "${OCF_RESKEY_monitor_link}" = "no" ] ||
+   [ "${OCF_RESKEY_monitor_link}" = "0" ]; then
+        OCF_RESKEY_monitor_link="no"
+else
         OCF_RESKEY_monitor_link="yes"
 fi
 
-
 case $1 in
 start)
 	if address_configured ${OCF_RESKEY_family} ${OCF_RESKEY_address}; then
-- 
1.6.2.5