"Andrew Beekhof" <[EMAIL PROTECTED]> writes:
>> 1. When 'start', setting the netmask causes an error when I
>>    specified a CIDR netmask. It was converted by findif in 2.0.7.
>
> Fixed as:
>   http://hg.beekhof.net/lha/crm-stable/rev/b4f60d5ded4b

Thanks, but I think this fix is nothing related to my problem...

>
>>
>> 2. 'stop' fails when I specified 'nic' parameter.
>>     From the sh -x option output, the following 'if' condition
>>     failed at L531.
>> ----
>> + '[' xeth0:0 '!=' x -a eth0 '!=' eth0:0 ']'
>> ----
>>
>> 3. 'stop' fails with another error when the interface was
>>    already down-ed.
>
> I ran the exact commands you listed for 2 and 3 on Gentoo and SLES10
> - it ran fine on both platforms
>
> Alas I dont have access to a redhat box... if you attach the complete
> "-x" output i could probably figure something out...


I attached my complete log with -x option.
This log is done after I applied your patch to findif.


I also attached my suggesting patch to fix those.

My patch includes fixes as below:

 - use caluclated netmask instead of the specified netmask param
   at ip_validate_all(): L806.
   will fix problem 1.

 - remove a sanity check at ip_stop(): L531
   will fix problem 2 and 3.
   I personally think that this sanity check is not
   necessary, as there was no such check in 2.0.7...

 - a variable name is obviously wrong for SunOS at
   add_interface(): L500 (I haven't test it though)

 - leave some info logs as 2.0.7 rather than using echo at L512.


>> My environment is:
>>
>> OS: RedHat ES4 Update 3
>> Heartbeat: see below (is this the right way to identify the revision?)
>
> "hg id" is usually enough

Thanks!

$ hg id
3d89093dd920 tip


-- 
Keisuke MORI
NTT DATA Intellilink Corporation

Attachment: IPaddr-20061122.log.gz
Description: Binary data

diff -r 3d89093dd920 resources/OCF/IPaddr.in
--- a/resources/OCF/IPaddr.in	Mon Nov 20 14:34:48 2006 -0700
+++ b/resources/OCF/IPaddr.in	Wed Nov 22 18:03:38 2006 +0900
@@ -464,6 +464,7 @@ delete_interface () {
 		CMD="$IFCONFIG $ifname down";;
   esac
 
+  ocf_log info "$CMD"
   $CMD
 
   return $?
@@ -497,7 +498,7 @@ add_interface () {
 	  #	CMD="$IFCONFIG $iface inet $ipaddr $netmask_text up"
 	  # So hack the following workaround:
 	  CMD="$IFCONFIG $iface inet $ipaddr"
-	  CMD="$CMD && $IFCONFIG $iface $netmask_text"
+	  CMD="$CMD && $IFCONFIG $iface $netmask"
 	  CMD="$CMD && $IFCONFIG $iface up"
 	  ;;
       
@@ -509,7 +510,7 @@ add_interface () {
   esac
 
   # Use "eval $CMD" (not "$CMD"): it might be a chain of two or more commands.
-  echo $CMD
+  ocf_log info "eval $CMD"
   eval $CMD
   rc=$?
   if [ $rc != 0 ]; then
@@ -526,12 +527,6 @@ ip_stop() {
 
   SENDARPPIDFILE="$SENDARPPIDDIR/send_arp-$OCF_RESKEY_ip"
   NIC=`find_interface $OCF_RESKEY_ip`
-  : ${OCF_RESKEY_nic=$NIC}
-
-  if [ x$NIC != x -a $OCF_RESKEY_nic != $NIC ]; then
-      ocf_log err "Attempt to remove $OCF_RESKEY_ip from an interface other than the one supplied"
-      return $OCF_ERR_ARGS
-  fi
 
   if [ -f "$SENDARPPIDFILE" ]; then
 	cat "$SENDARPPIDFILE" | xargs kill
@@ -803,14 +798,19 @@ ip_validate_all() {
     fi
 
     tmp=`echo "$NICINFO" | cut -f2 | cut -d ' ' -f2`
-    if [ "x$OCF_RESKEY_netmask" = "x" ]; then
-	ocf_log info "Using calculated netmask for ${OCF_RESKEY_ip}: $tmp"
-	OCF_RESKEY_netmask=$tmp
+# use calculated netmask to take the CIDR form
+    if [ x$tmp != x${OCF_RESKEY_netmask} ]; then
+        ocf_log info "Using calculated netmask for ${OCF_RESKEY_ip}: $tmp"
+        OCF_RESKEY_netmask=$tmp
+    fi
+#    if [ "x$OCF_RESKEY_netmask" = "x" ]; then
+#	ocf_log info "Using calculated netmask for ${OCF_RESKEY_ip}: $tmp"
+#	OCF_RESKEY_netmask=$tmp
 # We cant do this because netmask used to take the CIDR form...
 #    elif [ x$tmp != x${OCF_RESKEY_netmask} ]; then
 #	ocf_log err "Invalid parameter value: netmask [$OCF_RESKEY_netmask [Calculated netmask: $tmp]"
 #	return $OCF_ERR_ARGS
-    fi
+#    fi
     
     tmp=`echo "$NICINFO" | cut -f3 | cut -d ' ' -f2`
     if [ "x$OCF_RESKEY_broadcast" = "x" ]; then
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to