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: crm by andrew from 
      ([email protected])
   2. Linux-HA CVS: crm by andrew from 
      ([email protected])
   3. Linux-HA CVS: crm by andrew from 
      ([email protected])


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

Message: 1
Date: Tue, 14 Mar 2006 09:18:04 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Project : linux-ha
Module  : crm

Dir     : linux-ha/crm/admin


Modified Files:
        crm_attribute.c Makefile.am 


Log Message:
Write the crm_failcount CLI for getting and removing a resource's failcount for 
a given node.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/admin/crm_attribute.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- crm_attribute.c     8 Mar 2006 15:46:52 -0000       1.8
+++ crm_attribute.c     14 Mar 2006 16:18:03 -0000      1.9
@@ -1,4 +1,4 @@
-/* $Id: crm_attribute.c,v 1.8 2006/03/08 15:46:52 andrew Exp $ */
+/* $Id: crm_attribute.c,v 1.9 2006/03/14 16:18:03 andrew Exp $ */
 
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
@@ -57,16 +57,17 @@
 gboolean DO_DELETE = FALSE;
 gboolean inhibit_pe = FALSE;
 
-char *dest_node   = NULL;
-const char *type        = NULL;
-const char *dest_uname       = NULL;
-char *set_name    = NULL;
+char *dest_node = NULL;
+char *set_name  = NULL;
 char *attr_id   = NULL;
-char *attr_name   = NULL;
-const char *attr_value  = NULL;
+char *attr_name = NULL;
+const char *type       = NULL;
+const char *rsc_id     = NULL;
+const char *dest_uname = NULL;
+const char *attr_value = NULL;
 const char *crm_system_name = "crm_master";
 
-#define OPTARGS        "V?GDQU:u:s:n:v:l:t:i:!"
+#define OPTARGS        "V?GDQU:u:s:n:v:l:t:i:!r:"
 
 int
 main(int argc, char **argv)
@@ -92,6 +93,7 @@
                {"set-name", 1, 0,   's'},
                {"attr-name", 1, 0,  'n'},
                {"attr-value", 1, 0, 'v'},
+               {"resource-id", 1, 0, 'r'},
                {"lifetime", 1, 0, 'l'},
                {"inhibit-policy-engine", 0, 0, '!'},
                {"type", 1, 0, 't'},
@@ -171,6 +173,10 @@
                                crm_debug_2("Option %c => %s", flag, optarg);
                                attr_value = optarg;
                                break;
+                       case 'r':
+                               crm_debug_2("Option %c => %s", flag, optarg);
+                               rsc_id = optarg;
+                               break;
                        case '!':
                                inhibit_pe = TRUE;
                                break;
@@ -271,9 +277,24 @@
                crm_malloc0(set_name, len);
                sprintf(set_name, "master-%s", dest_node);
                
+       } else if(safe_str_eq(crm_system_name, "crm_failcount")) {
+               type = XML_CIB_TAG_STATUS;
+               if(rsc_id == NULL) {
+                       fprintf(stderr,"Please specify a resource with -r\n");
+                       return 1;
+               }
+               if(dest_node == NULL) {
+                       fprintf(stderr,"Please specify a node with -U or -u\n");
+                       return 1;       
+               }
+       
+               set_name = crm_concat("crmd-transient",dest_node, '-');
+               attr_name = crm_concat("fail-count", rsc_id, '-');
+               attr_id = crm_concat(attr_name, dest_node, '-');
+               
        } else if(safe_str_eq(crm_system_name, "crm_standby")) {
                if(dest_node == NULL) {
-                       fprintf(stderr,"Please specify a value for -U or -u\n");
+                       fprintf(stderr,"Please specify a node with -U or -u\n");
                        return 1;
 
                } else if(DO_DELETE) {
@@ -370,6 +391,9 @@
        } else if(safe_str_eq(cmd, "crm_standby")) {
                fprintf(stream, "usage: %s [-?V] -(u|U) -(D|G|v) [-l]\n", cmd);
 
+       } else if(safe_str_eq(cmd, "crm_failcount")) {
+               fprintf(stream, "usage: %s [-?V] -(u|U) -(D|G|v) -r\n", cmd);
+
        } else {
                fprintf(stream, "usage: %s [-?V] -(D|G|v) [options]\n", cmd);
        }
@@ -410,18 +434,24 @@
                "UUID of the node to change\n", "node-uuid", 'u');
        fprintf(stream, "\t--%s (-%c) <node_uuid>\t: "
                "uname of the node to change\n", "node-uname", 'U');
-       fprintf(stream, "\t--%s (-%c) <string>\t: "
-               "Set of attributes in which to read/write the attribute\n",
-               "set-name", 's');
-       fprintf(stream, "\t--%s (-%c) <string>\t: "
-               "Attribute to set\n", "attr-name", 'n');
-       fprintf(stream, "\t--%s (-%c) <string>\t: "
-               "Which section of the CIB to set the attribute: (%s|%s|%s)\n",
-               "type", 't',
-               XML_CIB_TAG_NODES, XML_CIB_TAG_STATUS, XML_CIB_TAG_CRMCONFIG);
-       fprintf(stream, "\t    -t=%s options: -(U|u) -n [-s]\n", 
XML_CIB_TAG_NODES);
-       fprintf(stream, "\t    -t=%s options: -(U|u) -n [-s]\n", 
XML_CIB_TAG_STATUS);
-       fprintf(stream, "\t    -t=%s options: -n [-s]\n", 
XML_CIB_TAG_CRMCONFIG);
+
+       if(safe_str_eq(cmd, "crm_failcount")) {
+               fprintf(stream, "\t--%s (-%c) <resource name>\t: "
+                       "name of the resource to operate on\n", "resource-id", 
'r');
+       } else {
+               fprintf(stream, "\t--%s (-%c) <string>\t: "
+                       "Set of attributes in which to read/write the 
attribute\n",
+                       "set-name", 's');
+               fprintf(stream, "\t--%s (-%c) <string>\t: "
+                       "Attribute to set\n", "attr-name", 'n');
+               fprintf(stream, "\t--%s (-%c) <string>\t: "
+                       "Which section of the CIB to set the attribute: 
(%s|%s|%s)\n",
+                       "type", 't',
+                       XML_CIB_TAG_NODES, XML_CIB_TAG_STATUS, 
XML_CIB_TAG_CRMCONFIG);
+               fprintf(stream, "\t    -t=%s options: -(U|u) -n [-s]\n", 
XML_CIB_TAG_NODES);
+               fprintf(stream, "\t    -t=%s options: -(U|u) -n [-s]\n", 
XML_CIB_TAG_STATUS);
+               fprintf(stream, "\t    -t=%s options: -n [-s]\n", 
XML_CIB_TAG_CRMCONFIG);
+       }
        fflush(stream);
 
        exit(exit_status);
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/admin/Makefile.am,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -3 -r1.31 -r1.32
--- Makefile.am 25 Oct 2005 13:55:51 -0000      1.31
+++ Makefile.am 14 Mar 2006 16:18:03 -0000      1.32
@@ -40,8 +40,8 @@
 
 ## binary progs
 hasbin_PROGRAMS                = crmadmin cibadmin ccm_tool crm_diff crm_mon 
iso8601 \
-                       crm_master crm_standby crm_attribute crm_resource \
-                       crm_verify crm_uuid
+                       crm_master crm_standby crm_failcount crm_attribute \
+                       crm_resource crm_verify crm_uuid
 
 ## SOURCES
 
@@ -92,6 +92,10 @@
 crm_attribute_CFLAGS   = -DHA_VARLIBDIR='"@HA_VARLIBDIR@"'
 crm_attribute_LDADD    = $(COMMONLIBS)
 
+crm_failcount_SOURCES  = crm_attribute.c
+crm_failcount_CFLAGS   = -DHA_VARLIBDIR='"@HA_VARLIBDIR@"'
+crm_failcount_LDADD    = $(COMMONLIBS)
+
 crm_resource_SOURCES   = crm_resource.c
 crm_resource_CFLAGS    = -DHA_VARLIBDIR='"@HA_VARLIBDIR@"'
 crm_resource_LDADD     = $(COMMONLIBS) \




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

Message: 2
Date: Tue, 14 Mar 2006 09:19:32 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Project : linux-ha
Module  : crm

Dir     : linux-ha/crm/crmd


Modified Files:
        lrm.c 


Log Message:
Change the attribute id for fail counts (matches whats used in crm_failcount) 

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/lrm.c,v
retrieving revision 1.169
retrieving revision 1.170
diff -u -3 -r1.169 -r1.170
--- lrm.c       11 Mar 2006 21:19:28 -0000      1.169
+++ lrm.c       14 Mar 2006 16:19:31 -0000      1.170
@@ -1350,7 +1350,7 @@
        if(op_status != LRM_OP_DONE) {
                char *attr_set = crm_concat("crmd-transient",fsa_our_uuid, '-');
                char *attr_name = crm_concat("fail-count", op->rsc_id, '-');
-               char *attr_id = crm_concat(fsa_our_uuid, attr_name,'-');
+               char *attr_id = crm_concat(attr_name, fsa_our_uuid, '-');
                
                update_attr(fsa_cib_conn, cib_none, XML_CIB_TAG_STATUS,
                            fsa_our_uuid, attr_set, attr_id, attr_name,




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

Message: 3
Date: Tue, 14 Mar 2006 09:20:14 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Project : linux-ha
Module  : crm

Dir     : linux-ha/crm/pengine


Modified Files:
        unpack.c 


Log Message:
Avoid creating constraints when we dont have to (failure stickiness)





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

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


End of Linux-ha-cvs Digest, Vol 28, Issue 28
********************************************

Reply via email to