Hi,

On Wed, Mar 16, 2011 at 04:58:25PM +0100, Corvus Corax wrote:
> 
> IPAddr2 puts the interface up on start and down on stop.
> But its not able to detect an UP or DOWN change in status or monitor.
> 
> Therefore an "ifconfig <interface> down" from a thrird program or a
> careless administrator would drop the link without pacemaker noticing!

Hmm, careless administrator is somewhat of a paradox, right?

Really, what was your motivation for this? It makes me wonder,
since this RA has existed for many years and so far nobody
bothered to test this.

Cheers,

Dejan

> The attached patch tries to fix that
> 
> -- 
> Eric Price
> Linux Solutions / Development
> 
> Lightwerk GmbH - www.lightwerk.com
> Schulze-Delitzsch-Str. 38, 70565 Stuttgart
> E-Mail: [email protected]
> 
> Geschäftsführender Gesellschafter: Veikko Wünsche
> Amtsgericht Stuttgart, HRB 22214
> Ust.-ID: DE 813315708
> 

> --- IPaddr2   2011-03-16 15:54:46.359554666 +0100
> +++ IPaddr2_lw        2011-03-16 16:38:33.728562036 +0100
> @@ -364,10 +364,21 @@
>       echo $iface
>       return 0
>  }
>  
>  #
> +#    Check interface status (up or down)
> +#    The argument is an interface name (e.g. "eth0")
> +#
> +interface_down() {
> +     if $IP2UTIL -o -f inet link show "$1" | grep "state UP" >/dev/null; then
> +             return 1
> +     fi
> +     return 0
> +}
> +
> +#
>  #        Delete an interface
>  #
>  delete_interface () {
>       ipaddr="$1"
>       iface="$2"
> @@ -572,20 +583,31 @@
>                               return 0
>                       fi
>                       ;;
>               esac
>  
> +             if interface_down $cur_nic; then
> +                     echo "partial3"
> +                     return 0
> +             fi
> +
>               echo "ok"
>               return 0
>       fi
>  
>       # Special handling for the CIP:
>       if [ ! -e $IP_CIP_FILE ]; then
>               echo "partial2"
>               return 0
>       fi
>       if egrep -q "(^|,)${IP_INC_NO}(,|$)" $IP_CIP_FILE ; then
> +
> +             if interface_down $cur_nic; then
> +                     echo "partial3"
> +                     return 0
> +             fi
> +
>               echo "ok"
>               return 0
>       else
>               echo "partial"
>               return 0
> @@ -620,10 +642,19 @@
>       #
>       #       Do we already service this IP address?
>       #
>       local ip_status=`ip_served`
>  
> +     # yes, but interface is down, bring it up!
> +     if [ "$ip_status" = "partial3" ]; then
> +             CMD="$IP2UTIL link set "$NIC" up"
> +
> +             ocf_log info "$CMD"
> +             $CMD
> +             ip_status=`ip_served`
> +     fi
> +
>       if [ "$ip_status" = "ok" ]; then
>               exit $OCF_SUCCESS
>       fi
>       
>       if [ -n "$IP_CIP" ] && [ $ip_status = "no" ] || [ $ip_status = 
> "partial2" ]; then

> _______________________________________________________
> Linux-HA-Dev: [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/

_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to