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: include by zhenh from
([email protected])
2. Linux-HA CVS: mgmt by zhenh from
([email protected])
3. Linux-HA CVS: cts by sunjd from ([email protected])
4. Linux-HA CVS: cts by sunjd from ([email protected])
----------------------------------------------------------------------
Message: 1
Date: Mon, 3 Apr 2006 02:27:03 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: include by zhenh from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : zhenh
Host :
Project : linux-ha
Module : include
Dir : linux-ha/include/mgmt
Modified Files:
mgmt_common.h
Log Message:
add standby support to mgmtd
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/mgmt/mgmt_common.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- mgmt_common.h 22 Dec 2005 07:21:18 -0000 1.3
+++ mgmt_common.h 3 Apr 2006 08:27:02 -0000 1.4
@@ -210,6 +210,19 @@
/*
description:
+ set standby on a node
+format:
+ MSG_STANDBY node on|off
+return:
+ MSG_OK
+or
+ MSG_FAIL reason
+*/
+#define MSG_STANDBY "standby"
+
+
+/*
+description:
return names of all running resources on a given node
format:
MSG_RUNNING_RSC node
------------------------------
Message: 2
Date: Mon, 3 Apr 2006 02:27:51 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: mgmt by zhenh from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : zhenh
Host :
Project : linux-ha
Module : mgmt
Dir : linux-ha/mgmt/daemon
Modified Files:
mgmt_crm.c
Log Message:
add standby support to mgmtd
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/daemon/mgmt_crm.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- mgmt_crm.c 30 Mar 2006 09:52:54 -0000 1.19
+++ mgmt_crm.c 3 Apr 2006 08:27:51 -0000 1.20
@@ -50,6 +50,7 @@
static char* on_get_activenodes(char* argv[], int argc);
static char* on_get_dc(char* argv[], int argc);
+static char* on_set_node_standby(char* argv[], int argc);
static char* on_get_node_config(char* argv[], int argc);
static char* on_get_running_rsc(char* argv[], int argc);
@@ -92,6 +93,8 @@
static void free_data_set(pe_working_set_t* data_set);
static void on_cib_connection_destroy(gpointer user_data);
static char* failed_msg(crm_data_t* output, int rc);
+static const char* uname2id(const char* node);
+
pe_working_set_t* cib_cached = NULL;
int cib_cache_enable = FALSE;
@@ -201,6 +204,25 @@
return ret;
}
+const char*
+uname2id(const char* uname)
+{
+ node_t* node;
+ GList* cur;
+ pe_working_set_t* data_set;
+
+ data_set = get_data_set();
+ cur = data_set->nodes;
+ while (cur != NULL) {
+ node = (node_t*) cur->data;
+ if (strncmp(uname,node->details->uname,MAX_STRLEN) == 0) {
+ return node->details->id;
+ }
+ cur = g_list_next(cur);
+ }
+ free_data_set(data_set);
+ return NULL;
+}
/* mgmtd functions */
int
@@ -243,7 +265,8 @@
reg_msg(MSG_ACTIVENODES, on_get_activenodes);
reg_msg(MSG_NODE_CONFIG, on_get_node_config);
reg_msg(MSG_RUNNING_RSC, on_get_running_rsc);
-
+ reg_msg(MSG_STANDBY, on_set_node_standby);
+
reg_msg(MSG_DEL_RSC, on_del_rsc);
reg_msg(MSG_CLEANUP_RSC, on_cleanup_rsc);
reg_msg(MSG_ADD_RSC, on_add_rsc);
@@ -484,7 +507,47 @@
free_data_set(data_set);
return cl_strdup(MSG_FAIL);
}
+char*
+on_set_node_standby(char* argv[], int argc)
+{
+ int rc;
+ const char* id = NULL;
+ crm_data_t* fragment = NULL;
+ crm_data_t* cib_object = NULL;
+ crm_data_t* output;
+ char xml[MAX_STRLEN];
+
+ ARGC_CHECK(3);
+ id = uname2id(argv[1]);
+ if (id == NULL) {
+ return cl_strdup(MSG_FAIL"\nno such node");
+ }
+
+ snprintf(xml, MAX_STRLEN,
+ "<node id=\"%s\"><instance_attributes id=\"standby-\%s\">"
+ "<attributes><nvpair id=\"standby-%s\" name=\"standby\"
value=\"%s\"/>"
+ "</attributes></instance_attributes></node>",
+ id, id, id, argv[2]);
+
+ cib_object = string2xml(xml);
+ if(cib_object == NULL) {
+ return cl_strdup(MSG_FAIL);
+ }
+
+ fragment = create_cib_fragment(cib_object, "nodes");
+ mgmt_log(LOG_DEBUG, "(update)xml:%s",xml);
+
+ rc = cib_conn->cmds->update(
+ cib_conn, "nodes", fragment, &output, cib_sync_call);
+
+ if (rc < 0) {
+ return failed_msg(output, rc);
+ }
+
+ return cl_strdup(MSG_OK);
+
+}
/* resource functions */
/* add/delete resource */
char*
------------------------------
Message: 3
Date: Mon, 3 Apr 2006 02:38:38 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: cts by sunjd from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : sunjd
Host :
Project : linux-ha
Module : cts
Dir : linux-ha/cts
Modified Files:
CTSlab.py.in
Log Message:
change the timeout value to be 20s, since the old value is too small sometimes
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cts/CTSlab.py.in,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -3 -r1.57 -r1.58
--- CTSlab.py.in 27 Mar 2006 03:05:03 -0000 1.57
+++ CTSlab.py.in 3 Apr 2006 08:38:37 -0000 1.58
@@ -69,10 +69,10 @@
self.sttype = sttype
self.nodes = nodes
- self.query_cmd_pat = '@libdir@/heartbeat/stonithdtest/apitest 0 %s
4000 0'
- self.reset_cmd_pat = '@libdir@/heartbeat/stonithdtest/apitest 1 %s
4000 0'
- self.poweron_cmd_pat = '@libdir@/heartbeat/stonithdtest/apitest 2 %s
4000 0'
- self.poweroff_cmd_pat= '@libdir@/heartbeat/stonithdtest/apitest 3 %s
4000 0'
+ self.query_cmd_pat = '@libdir@/heartbeat/stonithdtest/apitest 0 %s
20000 0'
+ self.reset_cmd_pat = '@libdir@/heartbeat/stonithdtest/apitest 1 %s
20000 0'
+ self.poweron_cmd_pat = '@libdir@/heartbeat/stonithdtest/apitest 2 %s
20000 0'
+ self.poweroff_cmd_pat= '@libdir@/heartbeat/stonithdtest/apitest 3 %s
20000 0'
self.lrmd_add_pat = '@libdir@/heartbeat/lrmadmin -A %s stonith ' +
sttype + ' NULL hostlist=%s'
self.lrmd_start_pat = '@libdir@/heartbeat/lrmadmin -E %s start 0 0
EVERYTIME'
------------------------------
Message: 4
Date: Mon, 3 Apr 2006 02:54:08 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: cts by sunjd from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : sunjd
Host :
Project : linux-ha
Module : cts
Dir : linux-ha/cts
Modified Files:
CM_hb.py.in CM_LinuxHAv2.py.in
Log Message:
replace the hardcode path
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cts/CM_hb.py.in,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- CM_hb.py.in 1 Sep 2005 18:29:07 -0000 1.39
+++ CM_hb.py.in 3 Apr 2006 08:54:08 -0000 1.40
@@ -61,10 +61,10 @@
"DRBDCheckconf" : "@sysconfdir@/init.d/drbd checkconfig
>/var/run/drbdconf 2>&1",
"BreakCommCmd" : "@libdir@/heartbeat/TestHeartbeatComm
break-communication >/dev/null 2>&1",
"FixCommCmd" : "@libdir@/heartbeat/TestHeartbeatComm
fix-communication >/dev/null 2>&1",
- "DelFileCommCmd" : "/usr/lib/heartbeat/TestHeartbeatComm
delete-testingfile >/dev/null 2>&1",
- "SaveFileCmd" : "/usr/lib/heartbeat/TestHeartbeatComm
save-testingfile /tmp/OnlyForTesting >/dev/null 2>&1",
- "ReduceCommCmd" : "/usr/lib/heartbeat/TestHeartbeatComm
reduce-communication %s %s>/dev/null 2>&1",
- "RestoreCommCmd" : "/usr/lib/heartbeat/TestHeartbeatComm
restore-communication /tmp/OnlyForTesting >/dev/null 2>&1",
+ "DelFileCommCmd" : "@libdir@/heartbeat/TestHeartbeatComm
delete-testingfile >/dev/null 2>&1",
+ "SaveFileCmd" : "@libdir@/heartbeat/TestHeartbeatComm
save-testingfile /tmp/OnlyForTesting >/dev/null 2>&1",
+ "ReduceCommCmd" : "@libdir@/heartbeat/TestHeartbeatComm
reduce-communication %s %s>/dev/null 2>&1",
+ "RestoreCommCmd" : "@libdir@/heartbeat/TestHeartbeatComm
restore-communication /tmp/OnlyForTesting >/dev/null 2>&1",
"IPaddrCmd" : "@sysconfdir@/ha.d/resource.d/IPaddr %s status",
"Standby" : "@libdir@/heartbeat/hb_standby >/dev/null 2>&1",
"TestConfigDir" : "@sysconfdir@/ha.d/testconfigs",
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cts/CM_LinuxHAv2.py.in,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -3 -r1.142 -r1.143
--- CM_LinuxHAv2.py.in 27 Mar 2006 07:26:34 -0000 1.142
+++ CM_LinuxHAv2.py.in 3 Apr 2006 08:54:08 -0000 1.143
@@ -71,7 +71,7 @@
"ExecuteRscOp" : "@libdir@/heartbeat/lrmadmin -E %s %s 0 0
EVERYTIME 2>/dev/null",
"CIBfile" : "%s:@HA_VARLIBDIR@/heartbeat/crm/cib.xml",
"TmpDir" : "/tmp",
- "BreakCommCmd2" : "/usr/lib/heartbeat/TestHeartbeatComm
break-communication %s>/dev/null 2>&1",
+ "BreakCommCmd2" : "@libdir@/heartbeat/TestHeartbeatComm
break-communication %s>/dev/null 2>&1",
"IsIPAddrRscRunning" : "",
"StandbyCmd" : "@sbindir@/crm_standby -U %s -v %s 2>/dev/null",
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 29, Issue 2
*******************************************