dlm: master - update copyright to 2012
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 9b486eb10b5a23eafc0d90cb8fc2ee8c89ad3116
Parent: 397a3d2f04f8ef0c5f771a394f513b727f1de337
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Apr 10 16:09:13 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Apr 10 16:09:13 2012 -0500
update copyright to 2012
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_controld/action.c | 2 +-
dlm_controld/config.c | 2 +-
dlm_controld/crc.c | 2 +-
dlm_controld/deadlock.c | 2 +-
dlm_controld/dlm_controld.h | 2 +-
dlm_controld/dlm_daemon.h | 2 +-
dlm_controld/fence.c | 2 +-
dlm_controld/lib.c | 2 +-
dlm_controld/libdlmcontrol.h | 2 +-
dlm_controld/linux_endian.h | 2 +-
dlm_controld/logging.c | 2 +-
dlm_controld/main.c | 2 +-
dlm_controld/member.c | 2 +-
dlm_controld/netlink.c | 2 +-
dlm_controld/plock.c | 2 +-
dlm_tool/main.c | 2 +-
16 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/dlm_controld/action.c b/dlm_controld/action.c
index d37d6ba..64c3923 100644
--- a/dlm_controld/action.c
+++ b/dlm_controld/action.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 Red Hat, Inc.
+ * Copyright 2004-2012 Red Hat, Inc.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
diff --git a/dlm_controld/config.c b/dlm_controld/config.c
index 830a619..cfceb3e 100644
--- a/dlm_controld/config.c
+++ b/dlm_controld/config.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 Red Hat, Inc.
+ * Copyright 2004-2012 Red Hat, Inc.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
diff --git a/dlm_controld/crc.c b/dlm_controld/crc.c
index 2b4b9c9..47ae7d8 100644
--- a/dlm_controld/crc.c
+++ b/dlm_controld/crc.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 Red Hat, Inc.
+ * Copyright 2004-2012 Red Hat, Inc.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
diff --git a/dlm_controld/deadlock.c b/dlm_controld/deadlock.c
index 51649d6..086ee5f 100644
--- a/dlm_controld/deadlock.c
+++ b/dlm_controld/deadlock.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 Red Hat, Inc.
+ * Copyright 2004-2012 Red Hat, Inc.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
diff --git a/dlm_controld/dlm_controld.h b/dlm_controld/dlm_controld.h
index 334408f..d25bfc5 100644
--- a/dlm_controld/dlm_controld.h
+++ b/dlm_controld/dlm_controld.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 Red Hat, Inc.
+ * Copyright 2004-2012 Red Hat, Inc.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
diff --git a/dlm_controld/dlm_daemon.h b/dlm_controld/dlm_daemon.h
index 93451ee..aa31c82 100644
--- a/dlm_controld/dlm_daemon.h
+++ b/dlm_controld/dlm_daemon.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 Red Hat, Inc.
+ * Copyright 2004-2012 Red Hat, Inc.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
diff --git a/dlm_controld/fence.c b/dlm_controld/fence.c
index bf5d316..e53f840 100644
--- a/dlm_controld/fence.c
+++ b/dlm_controld/fence.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 Red Hat, Inc.
+ * Copyright 2004-2012 Red Hat, Inc.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
diff --git a/dlm_controld/lib.c b/dlm_controld/lib.c
index 8b079b1..d1d3a23 100644
--- a/dlm_controld/lib.c
+++ b/dlm_controld/lib.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 Red Hat, Inc.
+ * Copyright 2004-2012 Red Hat, Inc.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
diff --git a/dlm_controld/libdlmcontrol.h b/dlm_controld/libdlmcontrol.h
index 436088b..068fe4e 100644
--- a/dlm_controld/libdlmcontrol.h
+++ b/dlm_controld/libdlmcontrol.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 Red Hat, Inc.
+ * Copyright 2004-2012 Red Hat, Inc.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
diff --git a/dlm_controld/linux_endian.h b/dlm_controld/linux_endian.h
index 625bf72..9fbd6bb 100644
--- a/dlm_controld/linux_endian.h
+++ b/dlm_controld/linux_endian.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 Red Hat, Inc.
+ * Copyright 2004-2012 Red Hat, Inc.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
diff --git a/dlm_controld/logging.c b/dlm_controld/logging.c
index 1b08c4f..d31249d 100644
--- a/dlm_controld/logging.c
+++ b/dlm_controld/logging.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 Red Hat, Inc.
+ * Copyright 2004-2012 Red Hat, Inc.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
diff --git a/dlm_controld/main.c b/dlm_controld/main.c
index 95abe12..e8c8af3 100644
--- a/dlm_controld/main.c
+++ b/dlm_controld/main.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 Red Hat, Inc.
+ * Copyright 2004-2012 Red Hat, Inc.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
diff --git a/dlm_controld/member.c b/dlm_controld/member.c
index d25ad42..ecdfabc 100644
--- a/dlm_controld/member.c
+++ b/dlm_controld/member.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 Red Hat, Inc.
+ * Copyright 2004-2012 Red Hat, Inc.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
diff --git a/dlm_controld/netlink.c b/dlm_controld/netlink.c
index 0f996d6..5f221dc 100644
--- a/dlm_controld/netlink.c
+++ b/dlm_controld/netlink.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 Red Hat, Inc.
+ * Copyright 2004-2012 Red Hat, Inc.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
diff --git a/dlm_controld/plock.c b/dlm_controld/plock.c
index 72bf6ea..28f07e6 100644
--- a/dlm_controld/plock.c
+++ b/dlm_controld/plock.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 Red Hat, Inc.
+ * Copyright 2004-2012 Red Hat, Inc.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
diff --git a/dlm_tool/main.c b/dlm_tool/main.c
index 8dba291..1ffd788 100644
--- a/dlm_tool/main.c
+++ b/dlm_tool/main.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 Red Hat, Inc.
+ * Copyright 2004-2012 Red Hat, Inc.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
12 years
dlm: master - release 3.99.2
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 9832cc8a622c195701ca28127c261aec8832c7e6
Parent: 9b486eb10b5a23eafc0d90cb8fc2ee8c89ad3116
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Apr 10 16:12:14 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Apr 10 16:12:14 2012 -0500
release 3.99.2
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
include/version.cf | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/version.cf b/include/version.cf
index f0ae01e..17c2c7b 100644
--- a/include/version.cf
+++ b/include/version.cf
@@ -1,6 +1,6 @@
#ifndef _RELEASE_VERSION_CF_
#define _RELEASE_VERSION_CF_
-#define RELEASE_VERSION "3.99.1"
+#define RELEASE_VERSION "3.99.2"
#endif
12 years
dlm: master - dlm_controld: lockspace config
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 397a3d2f04f8ef0c5f771a394f513b727f1de337
Parent: 5237439984d1af73389de59bd3b1f6638186f34b
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Apr 10 15:25:51 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Apr 10 15:35:06 2012 -0500
dlm_controld: lockspace config
read lockspace config from dlm.conf;
nodir and master weights
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_controld/action.c | 15 ++++-
dlm_controld/config.c | 153 +++++++++++++++++++++++++++++++++++++++----
dlm_controld/cpg.c | 7 ++-
dlm_controld/dlm_daemon.h | 20 ++++--
dlm_controld/fence_config.c | 4 +-
dlm_controld/main.c | 5 +-
6 files changed, 175 insertions(+), 29 deletions(-)
diff --git a/dlm_controld/action.c b/dlm_controld/action.c
index 8ac05b6..d37d6ba 100644
--- a/dlm_controld/action.c
+++ b/dlm_controld/action.c
@@ -160,6 +160,16 @@ int set_sysfs_id(char *name, uint32_t id)
return do_sysfs(name, "id", buf);
}
+int set_sysfs_nodir(char *name, int val)
+{
+ char buf[32];
+
+ memset(buf, 0, sizeof(buf));
+ snprintf(buf, 32, "%d", val);
+
+ return do_sysfs(name, "nodir", buf);
+}
+
static int update_dir_members(char *name)
{
char path[PATH_MAX];
@@ -234,7 +244,8 @@ int path_exists(const char *path)
call to set_members(). We rmdir/mkdir for these nodes so dlm-kernel
can notice they've left and rejoined. */
-int set_configfs_members(char *name, int new_count, int *new_members,
+int set_configfs_members(struct lockspace *ls, char *name,
+ int new_count, int *new_members,
int renew_count, int *renew_members)
{
char path[PATH_MAX];
@@ -364,7 +375,7 @@ int set_configfs_members(char *name, int new_count, int *new_members,
* set node's weight
*/
- w = get_weight(id, name);
+ w = get_weight(ls, id);
memset(path, 0, PATH_MAX);
snprintf(path, PATH_MAX, "%s/%s/nodes/%d/weight",
diff --git a/dlm_controld/config.c b/dlm_controld/config.c
index 93c8d64..830a619 100644
--- a/dlm_controld/config.c
+++ b/dlm_controld/config.c
@@ -8,20 +8,145 @@
#include "dlm_daemon.h"
-/*
- * TODO: lockspace master/nodir/weight
- */
+#if 0
+
+lockspace ls_name [ls_args]
+master ls_name node=nodeid [node_args]
+master ls_name node=nodeid [node_args]
+master ls_name node=nodeid [node_args]
+
+lockspace foo nodir=1
+master node=1 weight=2
+master node=2 weight=1
+
+#endif
+
+/* The max line length in dlm.conf */
+
+#define MAX_LINE 256
+
+int get_weight(struct lockspace *ls, int nodeid)
+{
+ int i;
+
+ /* if no masters are defined, everyone defaults to weight 1 */
+
+ if (!ls->master_count)
+ return 1;
+
+ for (i = 0; i < ls->master_count; i++) {
+ if (ls->master_nodeid[i] == nodeid)
+ return ls->master_weight[i];
+ }
+
+ /* if masters are defined, non-masters default to weight 0 */
+
+ return 0;
+}
-int get_weight(int nodeid, char *lockspace)
+static void read_master_config(struct lockspace *ls, FILE *file)
{
- /* default weight is 1 */
- return 1;
+ char line[MAX_LINE];
+ char name[MAX_LINE];
+ char args[MAX_LINE];
+ char *k;
+ int nodeid, weight, i;
+
+ while (fgets(line, MAX_LINE, file)) {
+ if (line[0] == '\n')
+ break;
+ if (line[0] == ' ')
+ break;
+ if (line[0] == '#')
+ continue;
+
+ if (strncmp(line, "master", strlen("master")))
+ break;
+
+ memset(name, 0, sizeof(name));
+ memset(args, 0, sizeof(args));
+ nodeid = 0;
+ weight = 1;
+
+ sscanf(line, "master %s %[^\n]s", name, args);
+
+ if (strcmp(name, ls->name))
+ break;
+
+ k = strstr(args, "node=");
+ if (!k)
+ break;
+
+ sscanf(k, "node=%d", &nodeid);
+ if (!nodeid)
+ break;
+
+ k = strstr(args, "weight=");
+ if (k)
+ sscanf(k, "weight=%d", &weight);
+
+ log_debug("config lockspace %s nodeid %d weight %d",
+ ls->name, nodeid, weight);
+
+ i = ls->master_count++;
+ ls->master_nodeid[i] = nodeid;
+ ls->master_weight[i] = weight;
+
+ if (ls->master_count >= MAX_NODES)
+ break;
+ }
+}
+
+void setup_lockspace_config(struct lockspace *ls)
+{
+ FILE *file;
+ char line[MAX_LINE];
+ char name[MAX_LINE];
+ char args[MAX_LINE];
+ char *k;
+ int val;
+
+ if (!path_exists(CONF_FILE_PATH))
+ return;
+
+ file = fopen(CONF_FILE_PATH, "r");
+ if (!file)
+ return;
+
+ while (fgets(line, MAX_LINE, file)) {
+ if (line[0] == '#')
+ continue;
+ if (line[0] == '\n')
+ continue;
+
+ if (strncmp(line, "lockspace", strlen("lockspace")))
+ continue;
+
+ memset(name, 0, sizeof(name));
+ memset(args, 0, sizeof(args));
+ val = 0;
+
+ sscanf(line, "lockspace %s %[^\n]s", name, args);
+
+ if (strcmp(name, ls->name))
+ continue;
+
+ k = strstr(args, "nodir=");
+ if (k) {
+ sscanf(k, "nodir=%d", &val);
+ ls->nodir = val;
+ }
+
+ read_master_config(ls, file);
+ }
+
+ fclose(file);
}
static void get_val_int(char *line, int *val_out)
{
- char key[PATH_MAX];
- char val[PATH_MAX];
+ char key[MAX_LINE];
+ char val[MAX_LINE];
int rv;
rv = sscanf(line, "%[^=]=%s", key, val);
@@ -33,8 +158,8 @@ static void get_val_int(char *line, int *val_out)
static void get_val_str(char *line, char *val_out)
{
- char key[PATH_MAX];
- char val[PATH_MAX];
+ char key[MAX_LINE];
+ char val[MAX_LINE];
int rv;
rv = sscanf(line, "%[^=]=%s", key, val);
@@ -48,8 +173,8 @@ void set_opt_file(int update)
{
struct dlm_option *o;
FILE *file;
- char line[PATH_MAX];
- char str[PATH_MAX];
+ char line[MAX_LINE];
+ char str[MAX_LINE];
int i, val;
if (!path_exists(CONF_FILE_PATH))
@@ -59,7 +184,7 @@ void set_opt_file(int update)
if (!file)
return;
- while (fgets(line, PATH_MAX, file)) {
+ while (fgets(line, MAX_LINE, file)) {
if (line[0] == '#')
continue;
if (line[0] == '\n')
@@ -67,7 +192,7 @@ void set_opt_file(int update)
memset(str, 0, sizeof(str));
- for (i = 0; i < PATH_MAX; i++) {
+ for (i = 0; i < MAX_LINE; i++) {
if (line[i] == ' ')
break;
if (line[i] == '=')
diff --git a/dlm_controld/cpg.c b/dlm_controld/cpg.c
index 49fb06a..6e508d2 100644
--- a/dlm_controld/cpg.c
+++ b/dlm_controld/cpg.c
@@ -552,9 +552,12 @@ static void start_kernel(struct lockspace *ls)
if (ls->joining)
set_sysfs_id(ls->name, ls->global_id);
+ if (ls->nodir)
+ set_sysfs_nodir(ls->name, 1);
+
format_member_ids(ls);
format_renew_ids(ls);
- set_configfs_members(ls->name, member_count, member_ids,
+ set_configfs_members(ls, ls->name, member_count, member_ids,
renew_count, renew_ids);
set_sysfs_control(ls->name, 1);
ls->kernel_stopped = 0;
@@ -1347,7 +1350,7 @@ static void confchg_cb(cpg_handle_t handle,
cpg callback we receive */
log_group(ls, "confchg for our leave");
stop_kernel(ls, 0);
- set_configfs_members(ls->name, 0, NULL, 0, NULL);
+ set_configfs_members(ls, ls->name, 0, NULL, 0, NULL);
set_sysfs_event_done(ls->name, 0);
cpg_finalize(ls->cpg_handle);
client_dead(ls->cpg_client);
diff --git a/dlm_controld/dlm_daemon.h b/dlm_controld/dlm_daemon.h
index 6fef5b4..93451ee 100644
--- a/dlm_controld/dlm_daemon.h
+++ b/dlm_controld/dlm_daemon.h
@@ -155,10 +155,6 @@ EXTERN struct dlm_option dlm_options[dlm_options_max];
#define MAX_NODE_ADDRESSES 4
-/* Max string length printed on a line, for debugging/dump output. */
-
-#define MAXLINE 256
-
#define PROTO_TCP 0
#define PROTO_SCTP 1
#define PROTO_DETECT 2
@@ -243,6 +239,13 @@ struct lockspace {
char name[DLM_LOCKSPACE_LEN+1];
uint32_t global_id;
+ /* dlm.conf config */
+
+ int nodir;
+ int master_count;
+ int master_nodeid[MAX_NODES];
+ int master_weight[MAX_NODES];
+
/* lockspace membership stuff */
cpg_handle_t cpg_handle;
@@ -295,8 +298,10 @@ struct lockspace {
int set_sysfs_control(char *name, int val);
int set_sysfs_event_done(char *name, int val);
int set_sysfs_id(char *name, uint32_t id);
-int set_configfs_members(char *name, int new_count, int *new_members,
- int renew_count, int *renew_members);
+int set_sysfs_nodir(char *name, int val);
+int set_configfs_members(struct lockspace *ls, char *name,
+ int new_count, int *new_members,
+ int renew_count, int *renew_members);
int add_configfs_node(int nodeid, char *addr, int addrlen, int local);
void del_configfs_node(int nodeid);
void clear_configfs(void);
@@ -308,7 +313,8 @@ int path_exists(const char *path);
/* config.c */
void set_opt_file(int update);
-int get_weight(int nodeid, char *lockspace);
+int get_weight(struct lockspace *ls, int nodeid);
+void setup_lockspace_config(struct lockspace *ls);
/* cpg.c */
void process_lockspace_changes(void);
diff --git a/dlm_controld/fence_config.c b/dlm_controld/fence_config.c
index f886630..66a1ad6 100644
--- a/dlm_controld/fence_config.c
+++ b/dlm_controld/fence_config.c
@@ -157,9 +157,7 @@ static int read_config_section(unsigned int nodeid, FILE *file, char *dev_line,
memset(con_name, 0, sizeof(con_name));
memset(con_args, 0, sizeof(con_args));
- rv = sscanf(line, "%s %s %[^\n]s", unused, con_name, con_args);
- if (rv < 3)
- return -EINVAL;
+ sscanf(line, "%s %s %[^\n]s", unused, con_name, con_args);
/* invalid config */
if (strncmp(dev_name, con_name, FENCE_CONFIG_NAME_MAX))
diff --git a/dlm_controld/main.c b/dlm_controld/main.c
index 14ac1c7..95abe12 100644
--- a/dlm_controld/main.c
+++ b/dlm_controld/main.c
@@ -188,6 +188,7 @@ static struct lockspace *create_ls(char *name)
INIT_LIST_HEAD(&ls->transactions);
INIT_LIST_HEAD(&ls->resources);
#endif
+ setup_lockspace_config(ls);
out:
return ls;
}
@@ -312,10 +313,12 @@ const char *dlm_mode_str(int mode)
/* recv "online" (join) and "offline" (leave) messages from dlm via uevents */
+#define MAX_LINE_UEVENT 256
+
static void process_uevent(int ci)
{
struct lockspace *ls;
- char buf[MAXLINE];
+ char buf[MAX_LINE_UEVENT];
char *argv[MAXARGS], *act, *sys;
int rv, argc = 0;
12 years
dlm: master - man: add man page for dlm.conf
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 5237439984d1af73389de59bd3b1f6638186f34b
Parent: 5a84b9719b8c39ff0a13bdd438745bfa02270219
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Apr 9 16:11:34 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Apr 10 10:34:40 2012 -0500
man: add man page for dlm.conf
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_controld/Makefile | 12 +-
dlm_controld/config.c | 9 -
dlm_controld/dlm.conf.5 | 393 +++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 399 insertions(+), 15 deletions(-)
diff --git a/dlm_controld/Makefile b/dlm_controld/Makefile
index b60b8df..2d46c35 100644
--- a/dlm_controld/Makefile
+++ b/dlm_controld/Makefile
@@ -7,8 +7,6 @@ HDRDIR=$(PREFIX)/include
MANDIR=$(PREFIX)/share/man
BIN_TARGET = dlm_controld
-MAN_TARGET = dlm_controld.8
-HDR_TARGET = libdlmcontrol.h
LIB_NAME = libdlmcontrol
LIB_MAJOR = 3
@@ -83,10 +81,12 @@ install: all
$(INSTALL) -d $(DESTDIR)/$(LIBDIR)
$(INSTALL) -d $(DESTDIR)/$(HDRDIR)
$(INSTALL) -d $(DESTDIR)/$(MANDIR)/man8
- $(INSTALL) -c -m 755 $(BIN_TARGET) $(DESTDIR)/$(BINDIR)
- $(INSTALL) -c -m 755 $(LIB_TARGET) $(DESTDIR)/$(LIBDIR)
+ $(INSTALL) -d $(DESTDIR)/$(MANDIR)/man5
+ $(INSTALL) -m 755 $(BIN_TARGET) $(DESTDIR)/$(BINDIR)
+ $(INSTALL) -m 755 $(LIB_TARGET) $(DESTDIR)/$(LIBDIR)
cp -a $(LIB_SO) $(DESTDIR)/$(LIBDIR)
cp -a $(LIB_SMAJOR) $(DESTDIR)/$(LIBDIR)
- $(INSTALL) -c -m 644 $(HDR_TARGET) $(DESTDIR)/$(HDRDIR)
- $(INSTALL) -m 644 $(MAN_TARGET) $(DESTDIR)/$(MANDIR)/man8/
+ $(INSTALL) -m 644 libdlmcontrol.h $(DESTDIR)/$(HDRDIR)
+ $(INSTALL) -m 644 dlm_controld.8 $(DESTDIR)/$(MANDIR)/man8/
+ $(INSTALL) -m 644 dlm.conf.5 $(DESTDIR)/$(MANDIR)/man5/
diff --git a/dlm_controld/config.c b/dlm_controld/config.c
index c07c6ee..93c8d64 100644
--- a/dlm_controld/config.c
+++ b/dlm_controld/config.c
@@ -10,15 +10,6 @@
/*
* TODO: lockspace master/nodir/weight
- *
- * lockspace foo nodir=1
- * master foo nodeid=1 weight=1
- * master foo nodeid=2 weight=1
- * master foo nodeid=3 weight=1
- *
- * lockspace bar nodir=1
- * master bar nodeid=4 weight=2
- * master bar nodeid=5 weight=1
*/
int get_weight(int nodeid, char *lockspace)
diff --git a/dlm_controld/dlm.conf.5 b/dlm_controld/dlm.conf.5
new file mode 100644
index 0000000..d722de7
--- /dev/null
+++ b/dlm_controld/dlm.conf.5
@@ -0,0 +1,393 @@
+.TH DLM.CONF 5 2012-04-09 dlm dlm
+
+.SH NAME
+dlm.conf \- dlm_controld configuration file
+
+.SH DESCRIPTION
+The configuration options in dlm.conf mirror the dlm_controld
+command line options. The config file additionally allows
+advanced fencing and lockspace configuration that are not
+supported on the command line.
+
+.SH Command line equivalents
+
+If an option is specified on the command line and in the config file, the
+command line setting overrides the config file setting.
+See
+.BR dlm_controld (8)
+for descriptions and dlm_controld -h for defaults.
+
+Format:
+
+key=val
+
+Example:
+
+log_debug=1
+.br
+post_join_delay=10
+.br
+protocol=tcp
+
+Options:
+
+daemon_debug
+.br
+log_debug
+.br
+protocol
+.br
+debug_logfile
+.br
+enable_plock
+.br
+plock_debug
+.br
+plock_rate_limit
+.br
+plock_ownership
+.br
+drop_resources_time
+.br
+drop_resources_count
+.br
+drop_resources_age
+.br
+post_join_delay
+.br
+enable_fencing
+.br
+enable_concurrent_fencing
+.br
+enable_startup_fencing
+.br
+enable_quorum_fencing
+.br
+enable_quorum_lockspace
+.br
+fence_all
+.br
+unfence_all
+.br
+
+.SH Fencing
+
+A fence device definition begins with a
+.B device
+line, followed by a number of
+.B connect
+lines, one for each node connected to the device.
+
+A blank line separates device definitions.
+
+Devices are used in the order they are listed.
+
+The
+.B device
+key word is followed by a unique
+.IR dev_name ,
+the
+.I agent
+program to be used, and
+.IR args ,
+which are agent arguments specific to the device.
+
+The
+.B connect
+key word is followed by the
+.I dev_name
+of the device section, the node ID of the connected node in the format
+.BI node= nodeid
+and
+.IR args ,
+which are agent arguments specific to the node for the given device.
+
+The format of
+.I args
+is key=val on both device and connect lines, each pair separated by a space,
+e.g. key1=val1 key2=val2 key3=val3.
+
+Format:
+
+.B device
+.I " dev_name"
+.I agent
+[args]
+.br
+.B connect
+.I dev_name
+.BI node= nodeid
+[args]
+.br
+.B connect
+.I dev_name
+.BI node= nodeid
+[args]
+.br
+.B connect
+.I dev_name
+.BI node= nodeid
+[args]
+.br
+
+Example:
+
+device foo fence_foo ipaddr=1.1.1.1 login=x password=y
+.br
+connect foo node=1 port=1
+.br
+connect foo node=2 port=2
+.br
+connect foo node=3 port=3
+
+device bar fence_bar ipaddr=2.2.2.2 login=x password=y
+.br
+connect bar node=1 port=1
+.br
+connect bar node=2 port=2
+.br
+connect bar node=3 port=3
+
+.SS Parallel devices
+
+Some devices, like dual power or dual path, must all be turned off in
+parallel for fencing to succeed. To define multiple devices as being
+parallel to each other, use the same base dev_name with different
+suffixes and a colon separator between base name and suffix.
+
+Format:
+
+.B device
+.IR " dev_name" :1
+.IR agent
+[args]
+.br
+.B connect
+.IR dev_name :1
+.BI node= nodeid
+[args]
+.br
+.B connect
+.IR dev_name :1
+.BI node= nodeid
+[args]
+.br
+.B connect
+.IR dev_name :1
+.BI node= nodeid
+[args]
+
+.B device
+.IR " dev_name" :2
+.I agent
+[args]
+.br
+.B connect
+.IR dev_name :2
+.BI node= nodeid
+[args]
+.br
+.B connect
+.IR dev_name :2
+.BI node= nodeid
+[args]
+.br
+.B connect
+.IR dev_name :2
+.BI node= nodeid
+[args]
+
+Example:
+
+device foo:1 fence_foo ipaddr=1.1.1.1 login=x password=y
+.br
+connect foo:1 node=1 port=1
+.br
+connect foo:2 node=2 port=2
+.br
+connect foo:3 node=3 port=3
+
+device foo:2 fence_foo ipaddr=5.5.5.5 login=x password=y
+.br
+connect foo:2 node=1 port=1
+.br
+connect foo:2 node=2 port=2
+.br
+connect foo:2 node=3 port=3
+
+.SS Unfencing
+
+A node may sometimes need to "unfence" itself when starting. The
+unfencing command reverses the effect of a previous fencing operation
+against it. An example would be fencing that disables a port on a SAN
+switch. A node could use unfencing to re-enable its switch port when
+starting up after rebooting. (Care must be taken to ensure it's safe for
+a node to unfence itself. A node often needs to be cleanly rebooted
+before unfencing itself.)
+
+To specify that a node should unfence itself for a given
+.BR device,
+the
+.B unfence
+line is added after the
+.B connect
+lines.
+
+Format:
+
+.B device
+.I " dev_name"
+.I agent
+[args]
+.br
+.B connect
+.I dev_name
+.BI node= nodeid
+[args]
+.br
+.B connect
+.I dev_name
+.BI node= nodeid
+[args]
+.br
+.B connect
+.I dev_name
+.BI node= nodeid
+[args]
+.br
+.BI "unfence " dev_name
+
+Example:
+
+device foo fence_foo ipaddr=1.1.1.1 login=x password=y
+.br
+connect foo node=1 port=1
+.br
+connect foo node=2 port=2
+.br
+connect foo node=3 port=3
+.br
+unfence foo
+
+.SS Simple devices
+
+In some cases, a single fence device is used for all nodes, and it
+requires no node-specific args. This would typically be a "bridge" fence
+device in which an agent is passing a fence request to another subsystem
+to handle. (Note that a "node=nodeid" arg is always automatically
+included in agent args, so a node-specific nodeid is always present to
+minimally identify the victim.)
+
+In such a case, a simplified, single-line fence configuration is possible,
+with format:
+
+.B fence_all
+.I agent
+[args]
+
+Example:
+
+fence_all dlm_stonith
+
+A fence_all configuration is not compatible with a fence device
+configuration (above).
+
+Unfencing can optionally be applied with:
+
+.B fence_all
+.I agent
+[args]
+.br
+.B unfence_all
+
+.SH Lockspace configuration
+
+A lockspace definition begins with a
+.B lockspace
+line, followed by a number of
+.B master
+lines. A blank line separates lockspace definitions.
+
+Format:
+
+.B lockspace
+.I ls_name
+[ls_args]
+.br
+.B master
+.I " ls_name"
+.BI node= nodeid
+[node_args]
+.br
+.B master
+.I " ls_name"
+.BI node= nodeid
+[node_args]
+.br
+.B master
+.I " ls_name"
+.BI node= nodeid
+[node_args]
+.br
+
+.SS Disabling resource directory
+
+Lockspaces usually use a resource directory to keep track of which node is
+the master of each resource. The dlm can operate without the resource
+directory, though, by statically assigning the master of a resource using
+a hash of the resource name. To enable, set the per-lockspace
+.B nodir
+option to 1.
+
+Example:
+
+lockspace foo nodir=1
+
+.SS Lock-server configuration
+
+The nodir setting can be combined with node weights to create a
+configuration where select node(s) are the master of all resources/locks.
+These master nodes can be viewed as "lock servers" for the other nodes.
+
+Example of nodeid 1 as master of all resources:
+
+lockspace foo nodir=1
+.br
+master node=1
+
+Example of nodeid's 1 and 2 as masters of all resources:
+
+lockspace foo nodir=1
+.br
+master node=1
+.br
+master node=2
+
+Lock management will be partitioned among the available masters. There
+can be any number of masters defined. The designated master nodes will
+master all resources/locks (according to the resource name hash). When no
+masters are members of the lockspace, then the nodes revert to the common
+fully-distributed configuration. Recovery is faster, with little
+disruption, when a non-master node joins/leaves.
+
+There is no special mode in the dlm for this lock server configuration,
+it's just a natural consequence of combining the "nodir" option with node
+weights. When a lockspace has master nodes defined, the master has a
+default weight of 1 and all non-master nodes have weight of 0. An explicit
+non-zero
+.B weight
+can also be assigned to master nodes, e.g.
+
+lockspace foo nodir=1
+.br
+master node=1 weight=2
+.br
+master node=2 weight=1
+
+In which case node 1 will master 2/3 of the total resources and node 2
+will master the other 1/3.
+
+.SH SEE ALSO
+.BR dlm_controld (8),
+.BR dlm_tool (8)
+
12 years
cluster: RHEL6 - Revert "Apply patch from John Ruemker to resolve rhbz#803474"
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 24d54d2abb33c858b28e6d53d03e1b243881657b
Parent: cd9d9be98b4276c4e73eac81563f54e92a08045d
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue Apr 10 06:16:08 2012 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue Apr 10 06:16:08 2012 +0200
Revert "Apply patch from John Ruemker to resolve rhbz#803474"
This reverts commit cd9d9be98b4276c4e73eac81563f54e92a08045d.
---
rgmanager/src/daemons/main.c | 8 +-------
rgmanager/src/daemons/rg_event.c | 4 ++--
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/rgmanager/src/daemons/main.c b/rgmanager/src/daemons/main.c
index 9a1e5e9..94047c3 100644
--- a/rgmanager/src/daemons/main.c
+++ b/rgmanager/src/daemons/main.c
@@ -456,13 +456,7 @@ dispatch_msg(msgctx_t *ctx, int nodeid, int need_close)
/* Centralized processing or request is from
clusvcadm */
nid = event_master();
- if (nid < 0) {
- logt_print(LOG_ERR, "#40b: Unable to determine "
- "event master\n");
- ret = -1;
- goto out;
- }
- else if (nid != my_id()) {
+ if (nid != my_id()) {
/* Forward the message to the event master */
forward_message(ctx, msg_sm, nid);
} else {
diff --git a/rgmanager/src/daemons/rg_event.c b/rgmanager/src/daemons/rg_event.c
index e6a2abd..7048bc6 100644
--- a/rgmanager/src/daemons/rg_event.c
+++ b/rgmanager/src/daemons/rg_event.c
@@ -247,7 +247,7 @@ static int
find_master(void)
{
event_master_t *masterinfo = NULL;
- void *data = NULL;
+ void *data;
uint32_t sz;
cluster_member_list_t *m;
uint64_t vn;
@@ -255,7 +255,7 @@ find_master(void)
m = member_list();
if (vf_read(m, "Transition-Master", &vn,
- (void **)(&data), &sz) != VFR_OK) {
+ (void **)(&data), &sz) < 0) {
logt_print(LOG_ERR, "Unable to discover master"
" status\n");
masterinfo = NULL;
12 years
cluster: RHEL59 - fence_scsi: add option for strict verification
by rohara
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 4b3a6a1103b3f83b1f5d34e0aef387c396126eca
Parent: 9d063bab03bb6df39d6b4664b78d8f001fe9e92c
Author: Ryan O'Hara <rohara(a)redhat.com>
AuthorDate: Tue Apr 3 13:46:34 2012 -0500
Committer: Ryan O'Hara <rohara(a)redhat.com>
CommitterDate: Mon Apr 9 14:37:34 2012 -0500
fence_scsi: add option for strict verification
Add new option --strict (-s) that will enable strict verification that
registrations are created on all paths. Previously this was the
default behavior. Strict verification will compare the number of times
the registration key exists on a device and the number of paths. This
is useful when testing multipath configurations. If this option is not
specified, the verification will simply check to make sure the
registration keys exist on the device.
Resolves: rhbz#782919
Signed-off-by: Ryan O'Hara <rohara(a)redhat.com>
Reviewed-by: Lon Hohberger <lhh(a)redhat.com>
---
fence/agents/scsi/fence_scsi_test.pl | 6 +++++-
fence/man/fence_scsi_test.8 | 8 ++++++++
2 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/fence/agents/scsi/fence_scsi_test.pl b/fence/agents/scsi/fence_scsi_test.pl
index c012a12..22c2b63 100755
--- a/fence/agents/scsi/fence_scsi_test.pl
+++ b/fence/agents/scsi/fence_scsi_test.pl
@@ -101,7 +101,9 @@ sub do_verify_on (\@$$)
@keys = grep { /^$node_key$/ } get_keys_register ($dev);
- if (scalar (@keys) != scalar (@devices)) {
+ if (scalar (@keys) == 0) {
+ $err++;
+ } elsif (defined $options{'s'} && (scalar (@keys) != scalar (@devices))) {
$err++;
}
@@ -322,6 +324,7 @@ sub get_options ()
"h|help",
"k|key=s",
"o|action=s",
+ "s|strict",
"t|test=s",
"v|verbose");
@@ -608,6 +611,7 @@ sub print_usage
print "\n";
print " -k, --key=VALUE Key to use with current action.\n";
print " -d, --devices=LIST Devices used for the current action.\n";
+ print " -s, --strict Perform strict verification.\n";
print " -h, --help Display this help and exit.\n";
print " -v, --verbose Verbose mode.\n";
print "\n";
diff --git a/fence/man/fence_scsi_test.8 b/fence/man/fence_scsi_test.8
index 57c3713..596bc2d 100644
--- a/fence/man/fence_scsi_test.8
+++ b/fence/man/fence_scsi_test.8
@@ -77,6 +77,14 @@ specified, fence_scsi_test will automatically use all devices found in
cluster volumes.
.TP
+\fB-s, --strict\fR
+Perform strict verification that registrations exist on all
+paths. This option is recommended when testing multipath
+configurations. When specified, fence_scsi_test will compare the
+number of paths to the number of times the registration key exists on
+the I_T nexus. This option only is only used with the "on" action.
+
+.TP
\fB-h, --help\fR
Print out a help message describing available options, then exit.
12 years
cluster: RHEL59 - fence_scsi_test: increment error count when reservation fails
by rohara
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 9d063bab03bb6df39d6b4664b78d8f001fe9e92c
Parent: e48ce7f40c8e285d5cddc654ed39e1e4381d44ed
Author: Ryan O'Hara <rohara(a)redhat.com>
AuthorDate: Tue Apr 3 09:13:07 2012 -0500
Committer: Ryan O'Hara <rohara(a)redhat.com>
CommitterDate: Mon Apr 9 14:35:50 2012 -0500
fence_scsi_test: increment error count when reservation fails
If the do_action_on subroutine fails to create a reservation, the
error count should be incremented not set to zero.
Resolves: rhbz#809481
Signed-off-by: Ryan O'Hara <rohara(a)redhat.com>
Reviewed-by: Lon Hohberger <lhh(a)redhat.com>
---
fence/agents/scsi/fence_scsi_test.pl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fence/agents/scsi/fence_scsi_test.pl b/fence/agents/scsi/fence_scsi_test.pl
index 5c2302c..c012a12 100755
--- a/fence/agents/scsi/fence_scsi_test.pl
+++ b/fence/agents/scsi/fence_scsi_test.pl
@@ -44,7 +44,7 @@ sub do_action_on (\@$$)
if (scalar (get_keys_reserve ($dev)) == 0) {
if (do_reserve ($dev, $node_key) != 0) {
- $err = 0;
+ $err++;
}
}
12 years
cluster: RHEL6 - Apply patch from John Ruemker to resolve rhbz#803474
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: cd9d9be98b4276c4e73eac81563f54e92a08045d
Parent: 54a29913c5de797da6adb69e03b38487fef451b4
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Mon Apr 9 15:34:08 2012 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Mon Apr 9 15:35:50 2012 -0400
Apply patch from John Ruemker to resolve rhbz#803474
---
rgmanager/src/daemons/main.c | 8 +++++++-
rgmanager/src/daemons/rg_event.c | 4 ++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/rgmanager/src/daemons/main.c b/rgmanager/src/daemons/main.c
index 94047c3..9a1e5e9 100644
--- a/rgmanager/src/daemons/main.c
+++ b/rgmanager/src/daemons/main.c
@@ -456,7 +456,13 @@ dispatch_msg(msgctx_t *ctx, int nodeid, int need_close)
/* Centralized processing or request is from
clusvcadm */
nid = event_master();
- if (nid != my_id()) {
+ if (nid < 0) {
+ logt_print(LOG_ERR, "#40b: Unable to determine "
+ "event master\n");
+ ret = -1;
+ goto out;
+ }
+ else if (nid != my_id()) {
/* Forward the message to the event master */
forward_message(ctx, msg_sm, nid);
} else {
diff --git a/rgmanager/src/daemons/rg_event.c b/rgmanager/src/daemons/rg_event.c
index 7048bc6..e6a2abd 100644
--- a/rgmanager/src/daemons/rg_event.c
+++ b/rgmanager/src/daemons/rg_event.c
@@ -247,7 +247,7 @@ static int
find_master(void)
{
event_master_t *masterinfo = NULL;
- void *data;
+ void *data = NULL;
uint32_t sz;
cluster_member_list_t *m;
uint64_t vn;
@@ -255,7 +255,7 @@ find_master(void)
m = member_list();
if (vf_read(m, "Transition-Master", &vn,
- (void **)(&data), &sz) < 0) {
+ (void **)(&data), &sz) != VFR_OK) {
logt_print(LOG_ERR, "Unable to discover master"
" status\n");
masterinfo = NULL;
12 years
dlm: master - dlm_controld: clean up unfence_all option
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 5a84b9719b8c39ff0a13bdd438745bfa02270219
Parent: adff37be43519da0cf40d7de541d217fbcf842c5
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Apr 5 15:58:37 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Apr 5 15:58:37 2012 -0500
dlm_controld: clean up unfence_all option
fix inconsistency, unfence_all is a boolean
that sets the unfence field in the fence_all_device
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_controld/config.c | 2 +-
dlm_controld/daemon_cpg.c | 4 ----
dlm_controld/dlm_controld.8 | 3 +--
dlm_controld/dlm_daemon.h | 2 +-
dlm_controld/main.c | 25 ++++++++++++++++---------
5 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/dlm_controld/config.c b/dlm_controld/config.c
index 1efea45..c07c6ee 100644
--- a/dlm_controld/config.c
+++ b/dlm_controld/config.c
@@ -53,7 +53,7 @@ static void get_val_str(char *line, char *val_out)
strcpy(val_out, val);
}
-void setup_config(int update)
+void set_opt_file(int update)
{
struct dlm_option *o;
FILE *file;
diff --git a/dlm_controld/daemon_cpg.c b/dlm_controld/daemon_cpg.c
index 3e7ed74..3ee5f7b 100644
--- a/dlm_controld/daemon_cpg.c
+++ b/dlm_controld/daemon_cpg.c
@@ -458,10 +458,6 @@ static struct node_daemon *add_node_daemon(int nodeid)
/* explicit command line arg has first priority */
if (dlm_options[fence_all_ind].cli_set) {
- memset(&fence_all_device, 0, sizeof(struct fence_device));
- strcpy(fence_all_device.name, "fence_all");
- strcpy(fence_all_device.agent, dlm_options[fence_all_ind].cli_str);
-
fc->dev[0] = &fence_all_device;
goto out;
}
diff --git a/dlm_controld/dlm_controld.8 b/dlm_controld/dlm_controld.8
index 99190da..262ef8a 100644
--- a/dlm_controld/dlm_controld.8
+++ b/dlm_controld/dlm_controld.8
@@ -89,8 +89,7 @@ For default settings, see dlm_controld -h.
fence all nodes with this agent
.B --unfence_all
-.I str
- unfence all nodes with this agent
+ enable unfencing self with fence_all agent
.B --help | -h
print this help, then exit
diff --git a/dlm_controld/dlm_daemon.h b/dlm_controld/dlm_daemon.h
index 788f4e8..6fef5b4 100644
--- a/dlm_controld/dlm_daemon.h
+++ b/dlm_controld/dlm_daemon.h
@@ -307,7 +307,7 @@ int setup_misc_devices(void);
int path_exists(const char *path);
/* config.c */
-void setup_config(int update);
+void set_opt_file(int update);
int get_weight(int nodeid, char *lockspace);
/* cpg.c */
diff --git a/dlm_controld/main.c b/dlm_controld/main.c
index cc1f0b5..14ac1c7 100644
--- a/dlm_controld/main.c
+++ b/dlm_controld/main.c
@@ -925,8 +925,6 @@ static void loop(void)
void (*workfn) (int ci);
void (*deadfn) (int ci);
- setup_config(0);
-
rv = setup_queries();
if (rv < 0)
goto out;
@@ -1215,6 +1213,8 @@ static void print_usage(void)
printf(" [%d]\n", o->default_int);
else if (o->req_arg == req_arg_bool)
printf(" [%d]\n", o->default_int);
+ else if (o->req_arg == no_arg && !o->default_int)
+ printf(" [0]\n");
else
printf("\n");
@@ -1338,9 +1338,9 @@ static void set_opt_defaults(void)
"fence all nodes with this agent");
set_opt_default(unfence_all_ind,
- "unfence_all", '\0', req_arg_str,
- -1, NULL,
- "unfence all nodes with this agent");
+ "unfence_all", '\0', no_arg,
+ 0, NULL,
+ "enable unfencing self with fence_all agent");
set_opt_default(help_ind,
"help", 'h', no_arg,
@@ -1546,18 +1546,25 @@ int main(int argc, char **argv)
struct sigaction act;
int fd, rv;
+ /*
+ * config priority: cli, config file, default
+ * - explicit cli setting will override default,
+ * - explicit file setting will override default
+ * - explicit file setting will not override explicit cli setting
+ */
+
set_opt_defaults();
+ set_opt_cli(argc, argv);
+ set_opt_file(0);
- memset(&fence_all_device, 0, sizeof(struct fence_device));
strcpy(fence_all_device.name, "fence_all");
- strcpy(fence_all_device.agent, dlm_options[fence_all_ind].default_str);
+ strcpy(fence_all_device.agent, opts(fence_all_ind));
+ fence_all_device.unfence = opt(unfence_all_ind);
INIT_LIST_HEAD(&lockspaces);
INIT_LIST_HEAD(&fs_register_list);
init_daemon();
- set_opt_cli(argc, argv);
-
if (!opt(daemon_debug_ind)) {
if (daemon(0, 0) < 0) {
perror("daemon error");
12 years, 1 month
dlm: master - dlm_controld: update man page
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 878c9fa5cd0d9a8be0f6e65361f50f43a8ec4843
Parent: ff1f5c78203613a8e28be6d7de1d558d598f8ca9
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Apr 5 14:39:59 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Apr 5 14:39:59 2012 -0500
dlm_controld: update man page
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_controld/dlm_controld.8 | 345 +++++++++----------------------------------
dlm_controld/main.c | 5 +-
2 files changed, 71 insertions(+), 279 deletions(-)
diff --git a/dlm_controld/dlm_controld.8 b/dlm_controld/dlm_controld.8
index 7100f0e..99190da 100644
--- a/dlm_controld/dlm_controld.8
+++ b/dlm_controld/dlm_controld.8
@@ -1,313 +1,104 @@
-.TH DLM_CONTROLD 8 2009-01-18 cluster cluster
+.TH DLM_CONTROLD 8 2012-04-05 dlm dlm
.SH NAME
-dlm_controld \- daemon that configures dlm according to cluster events
+dlm_controld \- dlm cluster control daemon
.SH SYNOPSIS
.B dlm_controld
[OPTIONS]
.SH DESCRIPTION
-The dlm lives in the kernel, and the cluster infrastructure (corosync
-membership and group management) lives in user space. The dlm in the
-kernel needs to adjust/recover for certain cluster events. It's the job
-of dlm_controld to receive these events and reconfigure the kernel dlm as
-needed. dlm_controld controls and configures the dlm through sysfs and
-configfs files that are considered dlm-internal interfaces.
-
-The cman init script usually starts the dlm_controld daemon.
+The kernel dlm requires a user daemon to manage lockspace membership.
+dlm_controld manages lockspace membership using corosync cpg groups,
+and translates membership changes into dlm kernel recovery events.
+dlm_controld also manages posix locks for cluster file systems using
+the dlm.
.SH OPTIONS
-Command line options override a corresponding setting in cluster.conf.
-
-.TP
-.B \-D
-Enable debugging to stderr and don't fork.
-.br
-See also
-.B dlm_tool dump
-in
-.BR dlm_tool (8).
-
-.TP
-.B \-L
-Enable debugging to log file.
-.br
-See also
-.B logging
-in
-.BR cluster.conf (5).
-
-.TP
-.B \-K
-Enable kernel dlm debugging messages.
-.br
-See also
-.B log_debug
-below.
-
-.TP
-.BI \-r " num"
-dlm kernel lowcomms protocol, 0 tcp, 1 sctp, 2 detect.
-2 selects tcp if corosync rrp_mode is "none", otherwise sctp.
-.br
-Default 2.
-
-.TP
-.BI \-g " num"
-groupd compatibility mode, 0 off, 1 on.
-.br
-Default 0.
-
-.TP
-.BI \-f " num"
-Enable (1) or disable (0) fencing recovery dependency.
-.br
-Default 1.
-
-.TP
-.BI \-q " num"
-Enable (1) or disable (0) quorum recovery dependency.
-.br
-Default 0.
-
-.TP
-.BI \-d " num"
-Enable (1) or disable (0) deadlock detection code.
-.br
-Default 0.
-
-.TP
-.BI \-p " num"
-Enable (1) or disable (0) plock code for cluster fs.
-.br
-Default 1.
-
-.TP
-.BI \-l " num"
-Limit the rate of plock operations, 0 for no limit.
-.br
-Default 0.
-
-.TP
-.BI \-o " num"
-Enable (1) or disable (0) plock ownership.
-.br
-Default 1.
-
-.TP
-.BI \-t " ms"
-Plock ownership drop resources time (milliseconds).
-.br
-Default 10000.
-
-.TP
-.BI \-c " num"
-Plock ownership drop resources count.
-.br
-Default 10.
-
-.TP
-.BI \-a " ms"
-Plock ownership drop resources age (milliseconds).
+Command line options override a corresponding setting in
+.BR dlm.conf (5).
.br
-Default 10000.
-
-.TP
-.B \-P
-Enable plock debugging messages (can produce excessive output).
-
-.TP
-.B \-h
-Print a help message describing available options, then exit.
-
-.TP
-.B \-V
-Print program version information, then exit.
-
-
-.SH FILES
-.BR cluster.conf (5)
-is usually located at /etc/cluster/cluster.conf. It is not read directly.
-Other cluster components load the contents into memory, and the values are
-accessed through the libccs library.
-
-Configuration options for dlm (kernel) and dlm_controld are added to the
-<dlm /> section of cluster.conf, within the top level <cluster> section.
-
-.SS Kernel options
-
-.TP
-.B protocol
-The network
-.B protocol
-can be set to tcp, sctp or detect which selects tcp or sctp based on
-the corosync rrp_mode configuration (redundant ring protocol).
-The rrp_mode "none" results in tcp. Default detect.
-
-<dlm protocol="detect"/>
-
-.TP
-.B timewarn
-After waiting
-.B timewarn
-centiseconds, the dlm will emit a warning via netlink. This only applies
-to lockspaces created with the DLM_LSFL_TIMEWARN flag, and is used for
-deadlock detection. Default 500 (5 seconds).
-
-<dlm timewarn="500"/>
-
-.TP
-.B log_debug
-DLM kernel debug messages can be enabled by setting
-.B log_debug
-to 1. Default 0.
-
-<dlm log_debug="0"/>
-
-.TP
-.B clusternode/weight
-The lock directory
-.B weight
-can be specified one the clusternode lines. Weights would usually be
-used in the lock server configurations shown below instead.
-
-<clusternode name="node01" nodeid="1" weight="1"/>
-
-.SS Daemon options
-
-.TP
-.B enable_fencing
-See command line description.
-
-<dlm enable_fencing="1"/>
-
-.TP
-.B enable_quorum
-See command line description.
-
-<dlm enable_quorum="0"/>
-
-.TP
-.B enable_deadlk
-See command line description.
-
-<dlm enable_deadlk="0"/>
-
-.TP
-.B enable_plock
-See command line description.
-
-<dlm enable_plock="1"/>
-
-.TP
-.B plock_rate_limit
-See command line description.
-
-<dlm plock_rate_limit="0"/>
-
-.TP
-.B plock_ownership
-See command line description.
-
-<dlm plock_ownership="1"/>
+For default settings, see dlm_controld -h.
-.TP
-.B drop_resources_time
-See command line description.
+.B --daemon_debug | -D
+ enable debugging to stderr and don't fork
-<dlm drop_resources_time="10000"/>
+.B --log_debug | -K
+ enable kernel dlm debugging messages
-.TP
-.B drop_resources_count
-See command line description.
+.B --protocol | -r
+.I str
+ dlm kernel lowcomms protocol: tcp, sctp, detect
-<dlm drop_resources_count="10"/>
+.B --debug_logfile | -L
+ write debugging to log file
-.TP
-.B drop_resources_age
-See command line description.
+.B --enable_plock | -p
+0|1
+ enable/disable posix lock support for cluster fs
-<dlm drop_resources_age="10000"/>
+.B --plock_debug | -P
+ enable plock debugging
-.TP
-.B plock_debug
-Enable (1) or disable (0) plock debugging messages (can produce excessive
-output). Default 0.
+.B --plock_rate_limit | -l
+.I int
+ limit rate of plock operations (0 for none)
-<dlm plock_debug="0"/>
+.B --plock_ownership | -o
+0|1
+ enable/disable plock ownership
+.B --drop_resources_time | -t
+.I int
+ plock ownership drop resources time (milliseconds)
-.SS Disabling resource directory
+.B --drop_resources_count | -c
+.I int
+ plock ownership drop resources count
-Lockspaces usually use a resource directory to keep track of which node is
-the master of each resource. The dlm can operate without the resource
-directory, though, by statically assigning the master of a resource using
-a hash of the resource name. To enable, set the per-lockspace
-.B nodir
-option to 1.
+.B --drop_resources_age | -a
+.I int
+ plock ownership drop resources age (milliseconds)
-.nf
-<dlm>
- <lockspace name="foo" nodir="1">
-</dlm>
-.fi
+.B --post_join_delay | -j
+.I int
+ seconds to delay fencing after cluster join
-.SS Lock-server configuration
+.B --enable_fencing | -f
+0|1
+ enable/disable fencing
-The nodir setting can be combined with node weights to create a
-configuration where select node(s) are the master of all resources/locks.
-These
-.B master
-nodes can be viewed as "lock servers" for the other nodes.
+.B --enable_concurrent_fencing
+0|1
+ enable/disable concurrent fencing
-.nf
-<dlm>
- <lockspace name="foo" nodir="1">
- <master name="node01"/>
- </lockspace>
-</dlm>
+.B --enable_startup_fencing | -s
+0|1
+ enable/disable startup fencing
-or,
+.B --enable_quorum_fencing | -q
+0|1
+ enable/disable quorum requirement for fencing
-<dlm>
- <lockspace name="foo" nodir="1">
- <master name="node01"/>
- <master name="node02"/>
- </lockspace>
-</dlm>
-.fi
+.B --enable_quorum_lockspace
+0|1
+ enable/disable quorum requirement for lockspace operations
-Lock management will be partitioned among the available masters. There
-can be any number of masters defined. The designated master nodes will
-master all resources/locks (according to the resource name hash). When no
-masters are members of the lockspace, then the nodes revert to the common
-fully-distributed configuration. Recovery is faster, with little
-disruption, when a non-master node joins/leaves.
+.B --fence_all
+.I str
+ fence all nodes with this agent
-There is no special mode in the dlm for this lock server configuration,
-it's just a natural consequence of combining the "nodir" option with node
-weights. When a lockspace has master nodes defined, the master has a
-default weight of 1 and all non-master nodes have weight of 0. An explicit
-non-zero
-.B weight
-can also be assigned to master nodes, e.g.
+.B --unfence_all
+.I str
+ unfence all nodes with this agent
-.nf
-<dlm>
- <lockspace name="foo" nodir="1">
- <master name="node01" weight="2"/>
- <master name="node02" weight="1"/>
- </lockspace>
-</dlm>
-.fi
+.B --help | -h
+ print this help, then exit
-In which case node01 will master 2/3 of the total resources and node2 will
-master the other 1/3.
+.B --version | -V
+ Print program version information, then exit
.SH SEE ALSO
.BR dlm_tool (8),
-.BR fenced (8),
-.BR cman (5),
-.BR cluster.conf (5)
+.BR dlm.conf (5)
diff --git a/dlm_controld/main.c b/dlm_controld/main.c
index 872cdfd..cc1f0b5 100644
--- a/dlm_controld/main.c
+++ b/dlm_controld/main.c
@@ -1183,7 +1183,8 @@ static void print_usage(void)
printf("\n");
printf("dlm_controld [options]\n");
printf("\n");
- printf("Options:\n");
+ printf("Option [arg]\n");
+ printf("Description [default]\n");
printf("\n");
for (i = 0; i < dlm_options_max; i++) {
@@ -1264,7 +1265,7 @@ static void set_opt_defaults(void)
set_opt_default(enable_fscontrol_ind,
"enable_fscontrol", '\0', req_arg_bool,
0, NULL,
- "enable/disable recovery coordination with fs controld");
+ ""); /* do not advertise */
set_opt_default(enable_plock_ind,
"enable_plock", 'p', req_arg_bool,
12 years, 1 month