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: heartbeat by blaschke from
([email protected])
2. Linux-HA CVS: lib by blaschke from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Fri, 9 Dec 2005 09:07:39 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: heartbeat by blaschke from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : blaschke
Host :
Project : linux-ha
Module : heartbeat
Dir : linux-ha/heartbeat
Modified Files:
config.c hb_config.h heartbeat.c
Log Message:
Bug 990 - Added -D option to tell heartbeat to display default directive
values and -W option to do so in wiki format
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/config.c,v
retrieving revision 1.183
retrieving revision 1.184
diff -u -3 -r1.183 -r1.184
--- config.c 8 Nov 2005 06:27:38 -0000 1.183
+++ config.c 9 Dec 2005 16:07:38 -0000 1.184
@@ -1,4 +1,4 @@
-/* $Id: config.c,v 1.183 2005/11/08 06:27:38 gshi Exp $ */
+/* $Id: config.c,v 1.184 2005/12/09 16:07:38 blaschke Exp $ */
/*
* Parse various heartbeat configuration files...
*
@@ -819,6 +819,110 @@
/*
+ * Dump the default configuration file values for those directives that
+ * have them
+ *
+ * This does not include every directive at this point.
+ */
+void
+dump_default_config(int wikiout)
+{
+ int j, k, lmaxlen = 0, cmaxlen = 0, rmaxlen = 0;
+ const char * dashes = "----------------------------------------"
+ "----------------------------------------";
+ const char * lcolhdr = "Directive";
+ const char * ccolhdr = "Default";
+ const char * rcolhdr = "Description";
+
+ /* First determine max name lens to help make things look nice */
+ for (j=0; j < DIMOF(Directives); ++j) {
+ struct directive * pdir = &Directives[j];
+ if (pdir->defaultvalue != NULL) {
+ if ((k = strlen(pdir->name)) > lmaxlen) {
+ lmaxlen = k;
+ }
+ if ((k = strlen(pdir->defaultvalue)) > cmaxlen) {
+ cmaxlen = k;
+ }
+ if ((pdir->explanation != NULL)
+ && ((k = strlen(pdir->explanation)) > rmaxlen)) {
+ rmaxlen = k;
+ }
+ }
+ }
+
+ /* Don't do anything if there are no default values */
+ if (!lmaxlen) {
+ printf("There are no default values for ha.cf directives\n");
+ return;
+ }
+
+ if (wikiout) {
+ printf("The [wiki:ha.cf ha.cf] directives that have default"
+ " values are shown in the table below along with the default"
+ " values and a brief description.\n\n");
+
+ printf("||\'\'%s\'\'||\'\'%s\'\'||\'\'%s\'\'||\n"
+ , lcolhdr, ccolhdr, rcolhdr);
+
+ for (j=0; j < DIMOF(Directives); ++j) {
+ char WikiName[lmaxlen+1];
+ char * pch;
+
+ if (Directives[j].defaultvalue) {
+ strcpy(WikiName, Directives[j].name);
+ WikiName[0] = toupper(WikiName[0]);
+
+ /* wiki convention is to remove underscores,
+ slide chars to left, and capitalize */
+ while ((pch = strchr(WikiName, '_')) != NULL) {
+ char *pchplus1 = pch + 1;
+ *pch = toupper(*pchplus1);
+ while (*pchplus1) {
+ *++pch = *++pchplus1;
+ }
+ }
+
+ printf("||[wiki:ha.cf/%sDirective"
+ " %s]||%s||%s||\n"
+ , WikiName
+ , Directives[j].name
+ , Directives[j].defaultvalue
+ , Directives[j].explanation);
+ }
+ }
+ } else {
+ if ((k = strlen(lcolhdr)) > lmaxlen) {
+ lmaxlen = k;
+ }
+ if ((k = strlen(ccolhdr)) > cmaxlen) {
+ cmaxlen = k;
+ }
+ if ((k = strlen(rcolhdr)) > rmaxlen) {
+ rmaxlen = k;
+ }
+
+ printf("%-*.*s %-*.*s %s\n", lmaxlen, lmaxlen, lcolhdr
+ , cmaxlen, cmaxlen, ccolhdr, rcolhdr);
+ /* this 4 comes from the pair of 2 blanks between columns */
+ printf("%-*.*s\n", sizeof(dashes)
+ , lmaxlen + cmaxlen + rmaxlen + 4, dashes);
+
+ for (j=0; j < DIMOF(Directives); ++j) {
+ if (Directives[j].defaultvalue) {
+ printf("%-*.*s %-*.*s %s\n"
+ , lmaxlen, lmaxlen
+ , Directives[j].name
+ , cmaxlen, cmaxlen
+ , Directives[j].defaultvalue
+ , Directives[j].explanation);
+ }
+ }
+ }
+}
+
+
+/*
* Check the /etc/ha.d/haresources file
*
* All we check for now is the set of node names.
@@ -2286,6 +2390,11 @@
/*
* $Log: config.c,v $
+ * Revision 1.184 2005/12/09 16:07:38 blaschke
+ *
+ * Bug 990 - Added -D option to tell heartbeat to display default directive
+ * values and -W option to do so in wiki format
+ *
* Revision 1.183 2005/11/08 06:27:38 gshi
* bug 949: this bcast message is caused by not compressing the message
* It was so because crmd/cib does not inherit the variable
traditional_compression
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/hb_config.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- hb_config.h 29 Jul 2005 06:55:37 -0000 1.4
+++ hb_config.h 9 Dec 2005 16:07:38 -0000 1.5
@@ -1,4 +1,4 @@
-/* $Id: hb_config.h,v 1.4 2005/07/29 06:55:37 sunjd Exp $ */
+/* $Id: hb_config.h,v 1.5 2005/12/09 16:07:38 blaschke Exp $ */
/*
* Parse various heartbeat configuration files...
*
@@ -25,6 +25,7 @@
int parse_ha_resources(const char * cfgfile);
void dump_config(void);
+void dump_default_config(int wikiout);
int add_node(const char * value, int nodetype);
int parse_authfile(void);
int init_config(const char * cfgfile);
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/heartbeat.c,v
retrieving revision 1.474
retrieving revision 1.475
diff -u -3 -r1.474 -r1.475
--- heartbeat.c 1 Dec 2005 23:22:28 -0000 1.474
+++ heartbeat.c 9 Dec 2005 16:07:38 -0000 1.475
@@ -2,7 +2,7 @@
* TODO:
* 1) Man page update
*/
-/* $Id: heartbeat.c,v 1.474 2005/12/01 23:22:28 gshi Exp $ */
+/* $Id: heartbeat.c,v 1.475 2005/12/09 16:07:38 blaschke Exp $ */
/*
* heartbeat: Linux-HA heartbeat code
*
@@ -268,7 +268,7 @@
#include "clplumbing/setproctitle.h"
#include <clplumbing/cl_pidfile.h>
-#define OPTARGS "dkMrRsvlC:V"
+#define OPTARGS "dDkMrRsvWlC:V"
#define ONEDAY (24*60*60) /* Seconds in a day */
#define REAPER_SIG 0x0001UL
#define TERM_SIG 0x0002UL
@@ -336,6 +336,8 @@
static void print_a_child_client(gpointer childentry, gpointer unused);
static seqno_t timer_lowseq = 0;
static gboolean init_deadtime_passed = FALSE;
+static int PrintDefaults = FALSE;
+static int WikiOutput = FALSE;
#undef DO_AUDITXMITHIST
#ifdef DO_AUDITXMITHIST
@@ -4262,6 +4264,9 @@
case 'd':
++debug_level;
break;
+ case 'D':
+ ++PrintDefaults;
+ break;
case 'k':
++killrunninghb;
break;
@@ -4289,6 +4294,9 @@
case 'V':
printversion();
cleanexit(LSB_EXIT_OK);
+ case 'W':
+ ++WikiOutput;
+ break;
default:
++argerrs;
@@ -4302,6 +4310,10 @@
if (argerrs || (CurrentStatus && !WeAreRestarting)) {
usage();
}
+ if (PrintDefaults) {
+ dump_default_config(WikiOutput);
+ cleanexit(LSB_EXIT_OK);
+ }
get_localnodeinfo();
SetParameterValue(KEY_HBVERSION, VERSION);
@@ -6019,6 +6031,11 @@
/*
* $Log: heartbeat.c,v $
+ * Revision 1.475 2005/12/09 16:07:38 blaschke
+ *
+ * Bug 990 - Added -D option to tell heartbeat to display default directive
+ * values and -W option to do so in wiki format
+ *
* Revision 1.474 2005/12/01 23:22:28 gshi
* print out the pid of the process being killed
*
------------------------------
Message: 2
Date: Fri, 9 Dec 2005 10:09:22 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by blaschke from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : blaschke
Host :
Project : linux-ha
Module : lib
Dir : linux-ha/lib/plugins/stonith
Added Files:
README.ibmbc ibmbc.c
Log Message:
Bug 393 initial drop (ibmbc not yet built)
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 25, Issue 20
********************************************