Send Linux-ha-cvs mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."


Today's Topics:

   1. Linux-HA CVS: membership by gshi from 
      ([email protected])
   2. Linux-HA CVS: heartbeat by gshi from 
      ([email protected])
   3. Linux-HA CVS: fencing by sunjd from 
      ([email protected])
   4. Linux-HA CVS: resources by davidlee from 
      ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Thu, 10 Nov 2005 14:33:31 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: membership by gshi from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : gshi
Host    : 
Project : linux-ha
Module  : membership

Dir     : linux-ha/membership/ccm


Modified Files:
        ccm.c 


Log Message:
ping node cannot be treated as new node in ccm


===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/membership/ccm/ccm.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -3 -r1.106 -r1.107
--- ccm.c       7 Nov 2005 22:55:44 -0000       1.106
+++ ccm.c       10 Nov 2005 21:33:30 -0000      1.107
@@ -137,7 +137,8 @@
                        ha_msg_del(msg);
                        msg = newmsg;
                } else if(strcasecmp(type, T_STATUS) == 0){
-                       
+                       const char* nodetype;
+
                        cl_log_message(LOG_DEBUG, msg);
                        if (llm_is_valid_node(&info->llm, orig)){
 
@@ -152,6 +153,19 @@
                                return TRUE;
                        }
                        
+                       nodetype = hb->llc_ops->node_type(hb, orig);
+                       if (nodetype == NULL){
+                               cl_log(LOG_ERR, "%s: get node %s's type failed",
+                                      __FUNCTION__, orig);
+                               return TRUE;
+                       }
+                       
+                       if (STRNCMP_CONST(nodetype, NORMALNODE) !=0 ){
+                               cl_log(LOG_ERR, "%s: wrong node type(%s) for 
node %s",
+                                      __FUNCTION__, nodetype, orig);
+                               return TRUE;
+                       }
+                       
                        if (llm_add(llm, orig, status, mynode) != HA_OK){
                                cl_log(LOG_ERR, "%s: adding node(%s) to llm 
failed",
                                       __FUNCTION__,orig);




------------------------------

Message: 2
Date: Thu, 10 Nov 2005 15:44:30 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: heartbeat by gshi from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : gshi
Host    : 
Project : linux-ha
Module  : heartbeat

Dir     : linux-ha/heartbeat


Modified Files:
        heartbeat.c 


Log Message:
remove one debug message

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/heartbeat.c,v
retrieving revision 1.470
retrieving revision 1.471
diff -u -3 -r1.470 -r1.471
--- heartbeat.c 10 Nov 2005 01:16:42 -0000      1.470
+++ heartbeat.c 10 Nov 2005 22:44:29 -0000      1.471
@@ -2,7 +2,7 @@
  * TODO:
  * 1) Man page update
  */
-/* $Id: heartbeat.c,v 1.470 2005/11/10 01:16:42 gshi Exp $ */
+/* $Id: heartbeat.c,v 1.471 2005/11/10 22:44:29 gshi Exp $ */
 /*
  * heartbeat: Linux-HA heartbeat code
  *
@@ -5136,10 +5136,6 @@
                        cl_log(LOG_ERR, "lost a lot of packets!");
                        return (IsToUs ? KEEPIT : DROPIT);
                }else{
-                       if (ANYDEBUG){
-                               cl_log(LOG_INFO, "calling request_msg_rexmit()"
-                                      "from %s", __FUNCTION__);
-                       }
                        request_msg_rexmit(thisnode, t->last_seq+1L, seq-1L);
                }
 
@@ -6016,6 +6012,9 @@
 
 /*
  * $Log: heartbeat.c,v $
+ * Revision 1.471  2005/11/10 22:44:29  gshi
+ * remove one debug message
+ *
  * Revision 1.470  2005/11/10 01:16:42  gshi
  * bug 693: Spread out load for packet retransmission requests
  *




------------------------------

Message: 3
Date: Fri, 11 Nov 2005 03:06:02 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: fencing by sunjd from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : sunjd
Host    : 
Project : linux-ha
Module  : fencing

Dir     : linux-ha/fencing/stonithd


Modified Files:
        stonithd.c 


Log Message:
Fix the bug 730: stonithd is killed by signal 11
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/fencing/stonithd/stonithd.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -3 -r1.76 -r1.77
--- stonithd.c  9 Nov 2005 08:18:38 -0000       1.76
+++ stonithd.c  11 Nov 2005 10:06:01 -0000      1.77
@@ -1,4 +1,4 @@
-/* $Id: stonithd.c,v 1.76 2005/11/09 08:18:38 sunjd Exp $ */
+/* $Id: stonithd.c,v 1.77 2005/11/11 10:06:01 sunjd Exp $ */
 
 /* File: stonithd.c
  * Description: STONITH daemon for node fencing
@@ -1960,6 +1960,13 @@
                return ST_FAIL;
        }
 
+       if ( (client = get_exist_client_by_chan(client_list, ch)) == NULL ) {
+               /* Here the ch are already destroyed */
+               stonithd_log(LOG_NOTICE, "It seems the client signed off, who "
+                       "raised the operation. So won't send out the result.");
+               return ST_OK;
+       }
+
        if (st_op->op_result == STONITH_SUCCEEDED ) {
                stonithd_log(LOG_INFO, "%s %s: optype=%d. whodoit: %s"
                        ,       M_STONITH_SUCCEED
@@ -1967,9 +1974,7 @@
                        ,       ((GString *)(st_op->node_list))->str);
                
                if ( st_op->optype == 1 ) { /* RESET */
-                       client = get_exist_client_by_chan(client_list, ch);
-                       if (  (client != NULL) 
-                           && (0 == STRNCMP_CONST(client->name, "apitest") )) {
+                       if (0 == STRNCMP_CONST(client->name, "apitest")) {
                                broadcast_reset_success(st_op->node_name);
                        }
                }
@@ -2505,6 +2510,7 @@
 {
        struct ha_msg * reply = NULL;
        IPC_Channel * ch = (IPC_Channel *)data;
+       stonithd_client_t * client = NULL;
 
        stonithd_log2(LOG_DEBUG, "send_stonithRAop_final_result: begin.");
        if ( ra_op == NULL || data == NULL ) {
@@ -2515,6 +2521,14 @@
 
        stonithd_log(LOG_DEBUG, "RA %s's op %s finished.", 
                     ra_op->ra_name, ra_op->op_type);
+
+       if ( (client = get_exist_client_by_chan(client_list, ch)) == NULL ) {
+               /* Here the ch are already destroyed */
+               stonithd_log(LOG_NOTICE, "It seems the client signed off, who "
+                       "raised the operation. So won't send out the result.");
+               return ST_OK;
+       }
+
        if ((reply = ha_msg_new(0)) == NULL) {
                stonithd_log(LOG_ERR, "%s:%d:ha_msg_new:out of memory."
                                ,__FUNCTION__, __LINE__);
@@ -3237,6 +3251,9 @@
 
 /* 
  * $Log: stonithd.c,v $
+ * Revision 1.77  2005/11/11 10:06:01  sunjd
+ * Fix the bug 730: stonithd is killed by signal 11
+ *
  * Revision 1.76  2005/11/09 08:18:38  sunjd
  * remove ZAPCHAN as gshi's suggestion, since it's not needed and perhaps 
casue bug 730
  *




------------------------------

Message: 4
Date: Fri, 11 Nov 2005 09:15:02 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: resources by davidlee from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : davidlee
Host    : 
Project : linux-ha
Module  : resources

Dir     : linux-ha/resources/OCF


Modified Files:
        ocf-shellfuncs.in IPaddr.in IPaddr2.in drbd.in 


Log Message:
Some bash-isms were making the OCF "sh" scripts non-portable.
Also identified some common code blocks, and separated these
out into "resources/OCF/ocf-shellfuncs.in".

Files in this update:
        resources/OCF/ocf-shellfuncs.in
        resources/OCF/IPaddr.in
        resources/OCF/IPaddr2.in
        resources/OCF/drbd.in

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/resources/OCF/ocf-shellfuncs.in,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- ocf-shellfuncs.in   26 Oct 2005 11:34:49 -0000      1.19
+++ ocf-shellfuncs.in   11 Nov 2005 16:15:02 -0000      1.20
@@ -1,5 +1,5 @@
 #
-#      $Id: ocf-shellfuncs.in,v 1.19 2005/10/26 11:34:49 andrew Exp $
+#      $Id: ocf-shellfuncs.in,v 1.20 2005/11/11 16:15:02 davidlee Exp $
 #
 #      Common helper functions for the OCF Resource Agents supplied by
 #      heartbeat.
@@ -40,6 +40,26 @@
 __SCRIPT_NAME=`basename $0`
 . ${HA_D}/shellfuncs
 
+ocf_is_root() {
+       set `/usr/bin/id`
+       [ $1 = "uid=0(root)" ]
+}
+
+ocf_is_decimal() {
+        # test: delete all decimal digits: result should be zero-length
+        [ -z "`echo $1 | tr -d '[0-9]'`" ]
+}
+
+ocf_is_hexadecimal() {
+        # test: delete all hex digits: result should be zero-length
+        [ -z "`echo $1 | tr -d '[0-9a-fA-F]'`" ]
+}
+
+ocf_is_octal() {
+        # test: delete all octal digits: result should be zero-length
+        [ -z "`echo $1 | tr -d '[0-7]'`" ]
+}
+
 __ocf_set_defaults() {
        __OCF_ACTION="$1"
 
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/resources/OCF/IPaddr.in,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- IPaddr.in   8 Nov 2005 02:08:57 -0000       1.28
+++ IPaddr.in   11 Nov 2005 16:15:02 -0000      1.29
@@ -43,7 +43,8 @@
 USAGE="usage: $0 {start|stop|status|monitor|validate-all|meta-data}";
 
 #######################################################################
-export LC_ALL=C
+LC_ALL=C
+export LC_ALL
 
 [EMAIL PROTECTED]@/ha.d
 . ${HA_D}/shellfuncs
@@ -194,7 +195,7 @@
 }
 
 ip_init() {
-        if [ $UID -ne 0 ]; then
+       if ocf_is_root ; then : ; else
                 ocf_log err "You must be root."
                 exit $OCF_ERR_PERM
         fi
@@ -223,11 +224,11 @@
            exit $OCF_ERR_GENERIC
        fi
 
-       if [ -z ${OCF_RESKEY_lvs_support} ]; then
+       if [ -z "${OCF_RESKEY_lvs_support}" ]; then
            LVS_SUPPORT=0
-       elif [ ${OCF_RESKEY_lvs_support} = "true"
-               -o ${OCF_RESKEY_lvs_support} = "on"
-               -o ${OCF_RESKEY_lvs_support} = "1" ]; then
+       elif [ x"${OCF_RESKEY_lvs_support}" = x"true"
+               -o x"${OCF_RESKEY_lvs_support}" = x"on"
+               -o x"${OCF_RESKEY_lvs_support}" = x"1" ]; then
            LVS_SUPPORT=1
        else
            LVS_SUPPORT=0
@@ -554,8 +555,8 @@
                fi;;
   esac
 
-  if [ ! -z ${OCF_RESKEY_local_stop_script} ]; then
-      if [ -x ${OCF_RESKEY_local_stop_script} ]; then
+  if [ ! -z "${OCF_RESKEY_local_stop_script}" ]; then
+      if [ -x "${OCF_RESKEY_local_stop_script}" ]; then
          ${OCF_RESKEY_local_stop_script} $*
       fi
   fi
@@ -723,8 +724,8 @@
          *)       ;;
       esac
   fi
-  if [ ! -z ${OCF_RESKEY_local_start_script} ]; then
-      if [ -x ${OCF_RESKEY_local_start_script} ]; then
+  if [ ! -z "${OCF_RESKEY_local_start_script}" ]; then
+      if [ -x "${OCF_RESKEY_local_start_script}" ]; then
          ${OCF_RESKEY_local_start_script} $*
       fi
   fi
@@ -835,12 +836,7 @@
 }
 
 is_positive_integer() {
-# We know $1 is non-empty beforehand
-    case $1 in
-       *[^0-9]*) false;; #got invalid char
-       *[1-9]*) true;; #no invalid char, at most one decimal point, contains 
non-zero digit <=> valid
-       *) false;; #"0" string
-    esac
+       ocf_is_decimal $1 && [ $1 -ge 1 ]
 }
 
 ip_validate_all() {
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/resources/OCF/IPaddr2.in,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- IPaddr2.in  1 Nov 2005 03:32:41 -0000       1.13
+++ IPaddr2.in  11 Nov 2005 16:15:02 -0000      1.14
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#      $Id: IPaddr2.in,v 1.13 2005/11/01 03:32:41 xunsun Exp $
+#      $Id: IPaddr2.in,v 1.14 2005/11/11 16:15:02 davidlee Exp $
 #
 #       OCF Resource Agent compliant IPaddr2 script.
 #
@@ -224,16 +224,8 @@
        exit $OCF_SUCCESS
 }
 
-is_decimal() {
-# We know $1 is non-empty beforehand
-    case $1 in
-       *[^0-9]*) false;; #got invalid char
-       *) true;;
-    esac
-}
-
 ip_init() {
-       if [ $UID -ne 0 ]; then
+       if ocf_is_root ; then : ; else
                ocf_log err "You must be root."
                exit $OCF_ERR_PERM
        fi
@@ -260,7 +252,7 @@
        ARP_BACKGROUND=${OCF_RESKEY_arp_bg:-yes}
        ARP_NETMASK=${OCF_RESKEY_arp_mac:-ffffffffffff}
 
-       if is_decimal "$IP_INC_GLOBAL" && [ $IP_INC_GLOBAL -gt 0 ]; then
+       if ocf_is_decimal "$IP_INC_GLOBAL" && [ $IP_INC_GLOBAL -gt 0 ]; then
                :
        else
                ocf_log err "Invalid OCF_RESKEY_incarnations_max_global 
[$IP_INC_GLOBAL], should be positive integer"
@@ -661,36 +653,20 @@
        esac
 }
 
-is_hexidecimal() {
-# We know $1 is non-empty beforehand
-    case $1 in
-       *[^0-9a-fA-F]*) false;; #got invalid char
-       *) true;;
-    esac
-}
-
-is_octal() {
-# We know $1 is non-empty beforehand
-    case $1 in
-       *[^0-7]*) false;; #got invalid char
-       *) true;;
-    esac
-}
-
 ip_validate() {
     ip_init
 
 # $BASEIP, $NETMASK, $NIC , $IP_INC_GLOBAL, and $BRDCAST have been checked 
within ip_init,
 # do not bother here.
        
-    if is_decimal "$ARP_INTERVAL_MS" && [ $ARP_INTERVAL_MS -gt 0 ]; then
+    if ocf_is_decimal "$ARP_INTERVAL_MS" && [ $ARP_INTERVAL_MS -gt 0 ]; then
        :
     else
        ocf_log err "Invalid OCF_RESKEY_arp_interval [$ARP_INTERVAL_MS]"
        exit $OCF_ERR_ARGS
     fi
 
-    if is_decimal "$ARP_REPEAT" && [ $ARP_REPEAT -gt 0 ]; then
+    if ocf_is_decimal "$ARP_REPEAT" && [ $ARP_REPEAT -gt 0 ]; then
        :
     else
        ocf_log err "Invalid OCF_RESKEY_arp_count [$ARP_REPEAT]"
@@ -719,7 +695,7 @@
        case $mark in
        0x*)    # hexidecimal
          mark=$(echo $mark | cut -c 3-)
-         if [ -n "$mark" ] && is_hexidecimal "$mark"; then
+         if [ -n "$mark" ] && ocf_is_hex "$mark"; then
                :
          else
                valid=0
@@ -727,14 +703,14 @@
          ;;
        0*)     # octal
          mark=$(echo $mark | cut -c 2-)
-         if [ -n "$mark" ] && is_octal "$mark"; then
+         if [ -n "$mark" ] && ocf_is_octal "$mark"; then
                :
          else
                valid=0
          fi
          ;;
        *)      # decimal
-         if [ -n "$mark" ] && is_decimal "$mark"; then
+         if [ -n "$mark" ] && ocf_is_decimal "$mark"; then
                :
          else
                valid=0
@@ -750,7 +726,7 @@
        case $IF_MAC in
        ??[^0-9]??[^0-9]??[^0-9]??[^0-9]??[^0-9]??)
                
mac=${IF_MAC:0:2}${IF_MAC:3:2}${IF_MAC:6:2}${IF_MAC:9:2}${IF_MAC:12:2}${IF_MAC:15:2}
-               if is_hexidecimal "$mac"; then
+               if ocf_is_hex "$mac"; then
                        case ${mac:1:1} in
                        0|2|4|6|8|a|A|c|C|e|E)
                                valid=0
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/resources/OCF/drbd.in,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- drbd.in     7 Nov 2005 15:44:22 -0000       1.14
+++ drbd.in     11 Nov 2005 16:15:02 -0000      1.15
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#      $Id: drbd.in,v 1.14 2005/11/07 15:44:22 xunsun Exp $
+#      $Id: drbd.in,v 1.15 2005/11/11 16:15:02 davidlee Exp $
 #
 #       OCF Resource Agent compliant drbd resource script.
 #
@@ -480,7 +480,7 @@
                drbd_validate_all
                ;;
 start|stop|monitor|promote|demote|notify)
-               if [ $UID -ne 0 ]; then
+               if ocf_is_root ; then : ; else
                        ocf_log err "You must be root to perform this 
operation."
                        exit $OCF_ERR_PERM
                fi




------------------------------

_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 24, Issue 46
********************************************

Reply via email to