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: lrm by sunjd from ([email protected])
2. Linux-HA CVS: resources by panjiam from
([email protected])
3. Linux-HA CVS: doc by lars from ([email protected])
----------------------------------------------------------------------
Message: 1
Date: Sun, 25 Jun 2006 19:48:21 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lrm by sunjd from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : sunjd
Host :
Project : linux-ha
Module : lrm
Dir : linux-ha/lrm/admin
Modified Files:
lrmadmin.c
Log Message:
(bug#1301) Support fake login name; adjust memory freeing
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lrm/admin/lrmadmin.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- lrmadmin.c 22 Jun 2006 21:00:57 -0000 1.40
+++ lrmadmin.c 26 Jun 2006 01:48:20 -0000 1.41
@@ -1,4 +1,4 @@
-/* $Id: lrmadmin.c,v 1.40 2006/06/22 21:00:57 davidlee Exp $ */
+/* $Id: lrmadmin.c,v 1.41 2006/06/26 01:48:20 sunjd Exp $ */
/* File: lrmadmin.c
* Description: A adminstration tool for Local Resource Manager
*
@@ -46,7 +46,7 @@
#include <clplumbing/GSource.h>
#include <clplumbing/Gmain_timeout.h>
-const char * optstring = "AD:dEF:d:sg:M:P:c:S:LI:CT:h";
+const char * optstring = "AD:dEF:d:sg:M:P:c:S:LI:CT:n:h";
#ifdef HAVE_GETOPT_H
static struct option long_options[] = {
@@ -70,6 +70,7 @@
GMainLoop *mainloop = NULL;
const char * lrmadmin_name = "lrmadmin";
+const char * fake_name = NULL;
/* 20 is the length limit for a argv[x] */
const int ARGVI_MAX_LEN = 48;
@@ -135,7 +136,7 @@
" {-D|--delete} <rscid>\n"
" {-F|--flush} <rscid>\n"
" {-E|--execute} <rscid> <operator> <timeout> <interval>
<target_rc|EVERYTIME|CHANGED> [<operator_parameters_list>]\n"
-" {-S|--state} <rscid>\n"
+" {-S|--state} <rscid> [-n <fake_name>]\n"
" {-L|--listall}\n"
" {-I|--information} <rsc_id>\n"
" {-C|--raclass_supported}\n"
@@ -158,7 +159,7 @@
const char * class, GHashTable ** params_ht);
static void g_print_stringitem_and_free(gpointer data, gpointer user_data);
static void g_print_rainfo_item_and_free(gpointer data, gpointer user_data);
-static void g_print_ops_and_free(gpointer data, gpointer user_data);
+static void g_print_ops(gpointer data, gpointer user_data);
static void g_get_rsc_description(gpointer data, gpointer user_data);
static void print_rsc_inf(lrm_rsc_t * lrmrsc);
static char * params_hashtable_to_str(const char * class, GHashTable * ht);
@@ -190,6 +191,7 @@
*ratype_list = 0,
*rscid_list;
char raclass[20];
+ const char * login_name = lrmadmin_name;
/* Prevent getopt_long to print error message on stderr isself */
/*opterr = 0; */
@@ -294,6 +296,12 @@
lrmadmin_cmd = INF_RSC;
break;
+ case 'n':
+ if (optarg) {
+ fake_name = optarg;
+ }
+ break;
+
case 'h':
OPTION_OBSCURE_CHECK
printf("%s",simple_help_screen);
@@ -322,7 +330,10 @@
lrmd->lrm_ops->set_lrm_callback(lrmd, lrm_op_done_callback);
- if (lrmd->lrm_ops->signon(lrmd, lrmadmin_name) != 1) { /* != HA_OK */
+ if (fake_name != NULL) {
+ login_name = fake_name;
+ }
+ if (lrmd->lrm_ops->signon(lrmd, login_name) != 1) { /* != HA_OK */
printf("lrmd daemon is not running.\n");
if (lrmadmin_cmd == DAEMON_OP) {
return LSB_STATUS_STOPPED;
@@ -490,12 +501,14 @@
cur_state==LRM_RSC_IDLE?
"LRM_RSC_IDLE":"LRM_RSC_BUSY");
- printf("The resource operation information:\n");
+ printf("The resource %d operations' "
+ "information:\n"
+ , g_list_length(ops_queue));
if (ops_queue) {
g_list_foreach(ops_queue,
- g_print_ops_and_free,
+ g_print_ops,
NULL);
- g_list_free(ops_queue);
+ lrm_free_op_list(ops_queue);
}
lrm_free_rsc(lrm_rsc);
}
@@ -850,7 +863,7 @@
static void
-g_print_ops_and_free(gpointer data, gpointer user_data)
+g_print_ops(gpointer data, gpointer user_data)
{
lrm_op_t* op = (lrm_op_t*)data;
GString * param_gstr;
@@ -864,7 +877,7 @@
param_gstr = g_string_new("");
g_hash_table_foreach(op->params, ocf_params_hash_to_str, ¶m_gstr);
- printf(" operation %s [call_id=%d]:\n"
+ printf(" operation '%s' [call_id=%d]:\n"
" start_delay=%d, interval=%d, timeout=%d, app_name=%s\n"
" rc=%d (%s), op_status=%d (%s)\n"
" parameters: %s\n"
@@ -876,7 +889,6 @@
, status_msg[(op->op_status-LRM_OP_PENDING) % DIMOF(status_msg)]
, param_gstr->str);
g_string_free(param_gstr, TRUE);
- lrm_free_op(op);
}
static void
@@ -982,6 +994,9 @@
/*
* $Log: lrmadmin.c,v $
+ * Revision 1.41 2006/06/26 01:48:20 sunjd
+ * (bug#1301) Support fake login name; adjust memory freeing
+ *
* Revision 1.40 2006/06/22 21:00:57 davidlee
* Beware null pointer in printf(%s)
*
------------------------------
Message: 2
Date: Sun, 25 Jun 2006 23:46:45 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: resources by panjiam from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : panjiam
Host :
Project : linux-ha
Module : resources
Dir : linux-ha/resources/OCF
Modified Files:
IPaddr.in
Log Message:
only start/stop operations need root permission, bug#1230
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/resources/OCF/IPaddr.in,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -3 -r1.42 -r1.43
--- IPaddr.in 12 Jun 2006 15:31:25 -0000 1.42
+++ IPaddr.in 26 Jun 2006 05:46:44 -0000 1.43
@@ -202,10 +202,17 @@
}
ip_init() {
- if ocf_is_root ; then : ; else
- ocf_log err "You must be root."
- exit $OCF_ERR_PERM
- fi
+ if
+ case $__OCF_ACTION in
+ start|stop) ocf_is_root;;
+ *) true;;
+ esac
+ then
+ : YAY!
+ else
+ ocf_log err "You must be root for $__OCF_ACTION operation."
+ exit $OCF_ERR_PERM
+ fi
#
# $FINDIF can NOT deal with the condition of empty intermediate
parameters.
------------------------------
Message: 3
Date: Mon, 26 Jun 2006 06:45:11 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: doc by lars from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : lars
Host :
Project : linux-ha
Module : doc
Dir : linux-ha/doc
Modified Files:
cibadmin.8.in
Log Message:
Small formatting fix.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/doc/cibadmin.8.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- cibadmin.8.in 9 Jun 2006 18:58:24 -0000 1.5
+++ cibadmin.8.in 26 Jun 2006 12:45:11 -0000 1.6
@@ -1,4 +1,4 @@
-.TH CIBADMIN 8 "$Date: 2006/06/09 18:58:24 $" "Linux-HA/OpenHA Project"
"Heartbeat @VERSION@ Adminstration Guide"
+.TH CIBADMIN 8 "$Date: 2006/06/26 12:45:11 $" "Linux-HA/OpenHA Project"
"Heartbeat @VERSION@ Adminstration Guide"
.SH NAME
\fIcibadmin\fP \- read, modify, or administer heartbeat Cluster Information
Base
.SH SYNOPSIS
@@ -112,10 +112,11 @@
.B \-\-cib_bump (\-B)
I have no idea what this option does \fB:\-)\fP
.TP 8
-.BI "\-\-host (\-h)" hostname
+.BI "\-\-host (\-h) " hostname
specifies the host to send this command to (rarely used, advanced option)
.TP 8
-.B \-\-local (\-l) command takes effect locally (rarely used advanced option)
+.B \-\-local (\-l)
+command takes effect locally (rarely used, advanced option)
.TP 8
.B \-\-no\-bcast (\-b)
Command will not be broadcast to other nodes, even if it modifies the CIB.
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 31, Issue 94
********************************************