From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19691 invoked by alias); 3 Apr 2009 14:13:01 -0000 Received: (qmail 19594 invoked by alias); 3 Apr 2009 14:13:00 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion.fedora.phx.redhat.com Subject: cluster: RHEL48 - rgmanager: Fix monitor_link="0" starts To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/RHEL48 X-Git-Reftype: branch X-Git-Oldrev: 21882a4d12306bf3e4f418a93aac65082c31951f X-Git-Newrev: da9f72456bdda7833f8360de92807b0f66cb334a From: Lon Hohberger Message-Id: <20090403141228.985471201C8@lists.fedorahosted.org> Date: Fri, 03 Apr 2009 14:13:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00021.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=da9f72456bdda7833f8360de92807b0f66cb334a Commit: da9f72456bdda7833f8360de92807b0f66cb334a Parent: 21882a4d12306bf3e4f418a93aac65082c31951f Author: Lon Hohberger AuthorDate: Tue Mar 31 14:57:15 2009 -0400 Committer: Lon Hohberger CommitterDate: Fri Apr 3 10:12:03 2009 -0400 rgmanager: Fix monitor_link="0" starts If link monitoring is disabled, still allow starting of the IP resource. rhbz489369 Signed-off-by: Lon Hohberger --- rgmanager/src/resources/ip.sh | 38 +++++++++++++++++++++----------------- 1 files changed, 21 insertions(+), 17 deletions(-) diff --git a/rgmanager/src/resources/ip.sh b/rgmanager/src/resources/ip.sh index 307449b..083738b 100755 --- a/rgmanager/src/resources/ip.sh +++ b/rgmanager/src/resources/ip.sh @@ -626,10 +626,16 @@ 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 ocf_log info "Adding IPv6 address $addr to $dev" fi if [ "$1" = "del" ]; then @@ -691,9 +697,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 @@ -808,15 +816,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" @@ -828,7 +830,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 @@ -879,11 +881,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