cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Lon Hohberger <lhh@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] Make fenced's retry time configurable;
Date: Wed, 30 Jan 2008 14:12:56 -0500	[thread overview]
Message-ID: <1201720377.15818.102.camel@ayanami.boston.devel.redhat.com> (raw)
In-Reply-To: <1201642952.15818.31.camel@ayanami.boston.devel.redhat.com>

Updated patch per Dave's comments:
 * change retry_time to override_time (since that's what it really is)
 * update manual pages

-- Lon

Index: fenced/fd.h
===================================================================
RCS file: /cvs/cluster/cluster/fence/fenced/fd.h,v
retrieving revision 1.27
diff -u -r1.27 fd.h
--- fenced/fd.h	26 Oct 2007 20:36:49 -0000	1.27
+++ fenced/fd.h	30 Jan 2008 19:11:01 -0000
@@ -132,12 +132,15 @@
 {
 	int post_join_delay;
 	int post_fail_delay;
+	int override_time;
+	int pad;
 	char *override_path;
 	int8_t clean_start;
 	int8_t post_join_delay_opt;
 	int8_t post_fail_delay_opt;
 	int8_t clean_start_opt;
 	int8_t override_path_opt;
+	int8_t override_time_opt;
 };
 
 #define FDFL_RUN        (0)
Index: fenced/main.c
===================================================================
RCS file: /cvs/cluster/cluster/fence/fenced/main.c,v
retrieving revision 1.46
diff -u -r1.46 main.c
--- fenced/main.c	7 Jan 2008 05:52:28 -0000	1.46
+++ fenced/main.c	30 Jan 2008 19:11:01 -0000
@@ -15,7 +15,7 @@
 #include "ccs.h"
 #include "copyright.cf"
 
-#define OPTION_STRING			("cj:f:Dn:O:hVS")
+#define OPTION_STRING			("cj:f:Dn:O:T:hVS")
 #define LOCKFILE_NAME			"/var/run/fenced.pid"
 
 struct client {
@@ -162,6 +162,20 @@
 			free(str);
 	}
 
+	if (comline.override_time_opt == FALSE) {
+		str = NULL;
+		memset(path, 0, 256);
+		sprintf(path, "/cluster/fence_daemon/@override_time");
+
+		error = ccs_get(cd, path, &str);
+		if (!error && str)
+			comline.override_time = atoi(str);
+		if (str)
+			free(str);
+		if (comline.override_time < 3)
+			comline.override_time = 3;
+	}
+
 	log_debug("delay post_join %ds post_fail %ds",
 		  comline.post_join_delay, comline.post_fail_delay);
 
@@ -576,6 +590,8 @@
 	comline->post_join_delay_opt = FALSE;
 	comline->post_fail_delay_opt = FALSE;
 	comline->clean_start_opt = FALSE;
+	comline->override_time_opt = FALSE;
+	comline->override_time = 5;	/* default */
 
 	while (cont) {
 		optchar = getopt(argc, argv, OPTION_STRING);
@@ -602,6 +618,13 @@
 			comline->override_path_opt = TRUE;
 			break;
 
+		case 'R':
+			comline->override_time = atoi(optarg);
+			if (comline->override_time < 3)
+				comline->override_time = 3;
+			comline->override_time_opt = TRUE;
+			break;
+
 		case 'D':
 			daemon_debug_opt = TRUE;
 			break;
Index: fenced/recover.c
===================================================================
RCS file: /cvs/cluster/cluster/fence/fenced/recover.c,v
retrieving revision 1.30
diff -u -r1.30 recover.c
--- fenced/recover.c	26 Oct 2007 20:36:49 -0000	1.30
+++ fenced/recover.c	30 Jan 2008 19:11:01 -0000
@@ -402,7 +402,8 @@
 
 		/* Check for manual intervention */
 		override = open_override(comline.override_path);
-		if (check_override(override, node->name, 5) > 0) {
+		if (check_override(override, node->name,
+				   comline.override_time) > 0) {
 			syslog(LOG_WARNING, "fence \"%s\" overridden by "
 			       "administrator intervention", node->name);
 
Index: man/fenced.8
===================================================================
RCS file: /cvs/cluster/cluster/fence/man/fenced.8,v
retrieving revision 1.7
diff -u -r1.7 fenced.8
--- man/fenced.8	17 Aug 2007 18:26:16 -0000	1.7
+++ man/fenced.8	30 Jan 2008 19:11:01 -0000
@@ -143,6 +143,12 @@
 
   <fence_daemon override_path="/var/run/cluster/fenced_override"/>
 
+Override-time is the amount of time to wait for administrator
intervention
+after fencing has failed.  The default is 5 seconds.
+
+  <fence_daemon override_time="10"/>
+
+
 .SS Per-node fencing settings
 
 The per-node fencing configuration can become complex and is largely
@@ -273,7 +279,11 @@
 All nodes are in a clean state to start.
 .TP
 \fB-O\fP
-Path of the override fifo.
+Path of the override FIFO.
+.TP
+\fB-T\fP
+Amount of time to wait for administrator intervention after 
+fencing has failed, in seconds.
 .TP
 \fB-D\fP
 Enable debugging code and don't fork into the background.




      reply	other threads:[~2008-01-30 19:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-29 21:42 [Cluster-devel] [PATCH] Make fenced's retry time configurable; Lon Hohberger
2008-01-30 19:12 ` Lon Hohberger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1201720377.15818.102.camel@ayanami.boston.devel.redhat.com \
    --to=lhh@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).