+++ /dev/null
-From 7b0b7b33b052fbd3a5b0cafd8dc134ce2ce713ec Mon Sep 17 00:00:00 2001
-From: David Teigland <teigland@redhat.com>
-Date: Thu, 16 Aug 2012 15:41:12 -0500
-Subject: [PATCH 3/3] dlm_controld: remove fence_all from cli
-
-The fence_all (and unfence_all) options were
-allowed as cli options, and as a fence config.
-This made parsing dlm.conf ambiguous because
-cli options in dlm.conf have x=y syntax, which
-is not the same as the fence config syntax.
-Remove the cli option because the config file
-will be more common/useful.
-
-Signed-off-by: David Teigland <teigland@redhat.com>
----
- dlm_controld/daemon_cpg.c | 11 ++---------
- dlm_controld/dlm.conf.5 | 4 ----
- dlm_controld/dlm_daemon.h | 2 --
- dlm_controld/fence.c | 2 +-
- dlm_controld/main.c | 14 ++------------
- 5 files changed, 5 insertions(+), 28 deletions(-)
-
-diff --git a/dlm_controld/daemon_cpg.c b/dlm_controld/daemon_cpg.c
-index fee0ef6..61d2da2 100644
---- a/dlm_controld/daemon_cpg.c
-+++ b/dlm_controld/daemon_cpg.c
-@@ -455,20 +455,13 @@ static struct node_daemon *add_node_daemon(int nodeid)
- fc = &node->fence_config;
- fc->nodeid = nodeid;
-
-- /* explicit command line arg has first priority */
--
-- if (dlm_options[fence_all_ind].cli_set) {
-- fc->dev[0] = &fence_all_device;
-- goto out;
-- }
--
-- /* explicit config file setting has second priority */
-+ /* explicit config file setting */
-
- rv = fence_config_init(fc, (unsigned int)nodeid, (char *)CONF_FILE_PATH);
- if (!rv)
- goto out;
-
-- /* no command line, no config file, so use default */
-+ /* no config file setting, so use default */
-
- if (rv == -ENOENT) {
- fc->dev[0] = &fence_all_device;
-diff --git a/dlm_controld/dlm.conf.5 b/dlm_controld/dlm.conf.5
-index d722de7..95f74b9 100644
---- a/dlm_controld/dlm.conf.5
-+++ b/dlm_controld/dlm.conf.5
-@@ -65,10 +65,6 @@ enable_quorum_fencing
- .br
- enable_quorum_lockspace
- .br
--fence_all
--.br
--unfence_all
--.br
-
- .SH Fencing
-
-diff --git a/dlm_controld/dlm_daemon.h b/dlm_controld/dlm_daemon.h
-index 7cb3c01..ffd501c 100644
---- a/dlm_controld/dlm_daemon.h
-+++ b/dlm_controld/dlm_daemon.h
-@@ -107,8 +107,6 @@ enum {
- enable_startup_fencing_ind,
- enable_quorum_fencing_ind,
- enable_quorum_lockspace_ind,
-- fence_all_ind,
-- unfence_all_ind,
- help_ind,
- version_ind,
- dlm_options_max,
-diff --git a/dlm_controld/fence.c b/dlm_controld/fence.c
-index e53f840..0094b3a 100644
---- a/dlm_controld/fence.c
-+++ b/dlm_controld/fence.c
-@@ -194,7 +194,7 @@ int unfence_node(int nodeid)
- }
- if (rv < 0) {
- /* there's a problem with the config */
-- log_error("fence config %d error %d", nodeid, rv);
-+ log_error("unfence %d fence_config_init error %d", nodeid, rv);
- return rv;
- }
-
-diff --git a/dlm_controld/main.c b/dlm_controld/main.c
-index c002520..6eafa49 100644
---- a/dlm_controld/main.c
-+++ b/dlm_controld/main.c
-@@ -1335,16 +1335,6 @@ static void set_opt_defaults(void)
- 1, NULL,
- "enable/disable quorum requirement for lockspace operations");
-
-- set_opt_default(fence_all_ind,
-- "fence_all", '\0', req_arg_str,
-- -1, "dlm_stonith",
-- "fence all nodes with this agent");
--
-- set_opt_default(unfence_all_ind,
-- "unfence_all", '\0', no_arg,
-- 0, NULL,
-- "enable unfencing self with fence_all agent");
--
- set_opt_default(help_ind,
- "help", 'h', no_arg,
- -1, NULL,
-@@ -1565,8 +1555,8 @@ int main(int argc, char **argv)
- set_opt_file(0);
-
- strcpy(fence_all_device.name, "fence_all");
-- strcpy(fence_all_device.agent, opts(fence_all_ind));
-- fence_all_device.unfence = opt(unfence_all_ind);
-+ strcpy(fence_all_device.agent, "dlm_stonith");
-+ fence_all_device.unfence = 0;
-
- INIT_LIST_HEAD(&lockspaces);
- INIT_LIST_HEAD(&fs_register_list);
---
-1.7.10.1.362.g242cab3
-
+++ /dev/null
-diff -dur dlm-3.99.5.orig/init/dlm.service dlm-3.99.5/init/dlm.service
---- dlm-3.99.5.orig/init/dlm.service 2012-06-21 23:53:56.000000000 +0200
-+++ dlm-3.99.5/init/dlm.service 2012-11-01 15:24:17.000000000 +0100
-@@ -1,6 +1,6 @@
- [Unit]
- Description=dlm control daemon
--After=syslog.target network.target corosync.service
-+After=syslog.target network.target corosync.service sys-kernel-config.mount
-
- [Service]
- Type=forking
+++ /dev/null
-diff -dur dlm-3.99.5.orig/dlm_controld/Makefile dlm-3.99.5/dlm_controld/Makefile
---- dlm-3.99.5.orig/dlm_controld/Makefile 2012-06-21 23:53:56.000000000 +0200
-+++ dlm-3.99.5/dlm_controld/Makefile 2012-10-25 10:04:07.000000000 +0200
-@@ -62,10 +62,10 @@
- all: $(LIB_TARGET) $(BIN_TARGET)
-
- $(BIN_TARGET): $(BIN_SOURCE)
-- $(CC) $(BIN_CFLAGS) $(BIN_LDFLAGS) $(BIN_SOURCE) -o $@ -L.
-+ $(CC) $(BIN_SOURCE) $(BIN_CFLAGS) $(BIN_LDFLAGS) -o $@ -L.
-
- $(LIB_TARGET): $(LIB_SOURCE)
-- $(CC) $(LIB_CFLAGS) $(LIB_LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_SMAJOR) $^
-+ $(CC) $^ $(LIB_CFLAGS) $(LIB_LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_SMAJOR)
- ln -sf $(LIB_TARGET) $(LIB_SO)
- ln -sf $(LIB_TARGET) $(LIB_SMAJOR)
-
-diff -dur dlm-3.99.5.orig/dlm_tool/Makefile dlm-3.99.5/dlm_tool/Makefile
---- dlm-3.99.5.orig/dlm_tool/Makefile 2012-06-21 23:53:56.000000000 +0200
-+++ dlm-3.99.5/dlm_tool/Makefile 2012-10-25 10:04:26.000000000 +0200
-@@ -39,7 +39,7 @@
- all: $(BIN_TARGET)
-
- $(BIN_TARGET): $(BIN_SOURCE)
-- $(CC) $(BIN_CFLAGS) $(BIN_LDFLAGS) $(BIN_SOURCE) -o $@
-+ $(CC) $(BIN_SOURCE) $(BIN_CFLAGS) $(BIN_LDFLAGS) -o $@
-
- clean:
- rm -f *.o *.so *.so.* $(BIN_TARGET)
-diff -dur dlm-3.99.5.orig/fence/Makefile dlm-3.99.5/fence/Makefile
---- dlm-3.99.5.orig/fence/Makefile 2012-06-21 23:53:56.000000000 +0200
-+++ dlm-3.99.5/fence/Makefile 2012-10-25 10:04:43.000000000 +0200
-@@ -40,7 +40,7 @@
- all: $(BIN_TARGET)
-
- $(BIN_TARGET): $(BIN_SOURCE)
-- $(CC) $(BIN_CFLAGS) $(BIN_LDFLAGS) $(BIN_SOURCE) -o $@ -L.
-+ $(CC) $(BIN_SOURCE) $(BIN_CFLAGS) $(BIN_LDFLAGS) -o $@ -L.
-
- clean:
- rm -f *.o *.so *.so.* $(BIN_TARGET)
-diff -dur dlm-3.99.5.orig/libdlm/Makefile dlm-3.99.5/libdlm/Makefile
---- dlm-3.99.5.orig/libdlm/Makefile 2012-06-21 23:53:56.000000000 +0200
-+++ dlm-3.99.5/libdlm/Makefile 2012-10-25 10:05:41.000000000 +0200
-@@ -86,18 +86,18 @@
- all: $(LIB_TARGET) $(LLT_TARGET) $(LIB_PC) $(LLT_PC)
-
- $(LIB_O): $(SOURCE)
-- $(CC) $(LIB_CFLAGS) -c -o $@ $<
-+ $(CC) $< $(LIB_CFLAGS) -c -o $@
-
- $(LLT_O): $(SOURCE)
-- $(CC) $(LLT_CFLAGS) -c -o $@ $<
-+ $(CC) $< $(LLT_CFLAGS) -c -o $@
-
- $(LIB_TARGET): $(LIB_O)
-- $(CC) $(LIB_LDFLAGS) -shared -o $@ -Wl,-soname=$(LIB_SMAJOR) $^
-+ $(CC) $^ $(LIB_LDFLAGS) -shared -o $@ -Wl,-soname=$(LIB_SMAJOR)
- ln -sf $(LIB_TARGET) $(LIB_SO)
- ln -sf $(LIB_TARGET) $(LIB_SMAJOR)
-
- $(LLT_TARGET): $(LLT_O)
-- $(CC) $(LLT_LDFLAGS) -shared -o $@ -Wl,-soname=$(LLT_SMAJOR) $^
-+ $(CC) $^ $(LLT_LDFLAGS) -shared -o $@ -Wl,-soname=$(LLT_SMAJOR)
- ln -sf $(LLT_TARGET) $(LLT_SO)
- ln -sf $(LLT_TARGET) $(LLT_SMAJOR)
-
+++ /dev/null
-diff -dur dlm-3.99.5.orig/dlm_controld/fence_config.c dlm-3.99.5/dlm_controld/fence_config.c
---- dlm-3.99.5.orig/dlm_controld/fence_config.c 2012-06-21 23:53:56.000000000 +0200
-+++ dlm-3.99.5/dlm_controld/fence_config.c 2012-11-02 08:31:53.000000000 +0100
-@@ -251,6 +251,7 @@
- rv = -ENOMEM;
- goto out;
- }
-+ memset(dev, 0, sizeof(struct fence_device));
-
- rv = sscanf(line, "%s %s %[^\n]s\n", dev->name, dev->agent, dev->args);
- if (rv < 2) {
--- /dev/null
+From f15a2daed7137481c7161e1447b1796c308c7e08 Mon Sep 17 00:00:00 2001
+From: David Teigland <teigland@redhat.com>
+Date: Tue, 06 Nov 2012 21:40:00 +0000
+Subject: dlm_controld: fix modes for run dir and file
+
+dir should be 775 and file 644
+
+Signed-off-by: David Teigland <teigland@redhat.com>
+---
+diff --git a/dlm_controld/main.c b/dlm_controld/main.c
+index 91fbc4f..a68e1b8 100644
+--- a/dlm_controld/main.c
++++ b/dlm_controld/main.c
+@@ -1107,7 +1107,7 @@ static int lockfile(const char *dir, const char *name)
+ int fd, rv;
+
+ old_umask = umask(0022);
+- rv = mkdir(dir, 0777);
++ rv = mkdir(dir, 0775);
+ if (rv < 0 && errno != EEXIST) {
+ umask(old_umask);
+ return rv;
+@@ -1116,7 +1116,7 @@ static int lockfile(const char *dir, const char *name)
+
+ snprintf(path, PATH_MAX, "%s/%s", dir, name);
+
+- fd = open(path, O_CREAT|O_WRONLY|O_CLOEXEC, 0666);
++ fd = open(path, O_CREAT|O_WRONLY|O_CLOEXEC, 0644);
+ if (fd < 0) {
+ log_error("lockfile open error %s: %s",
+ path, strerror(errno));
+--
+cgit v0.9.0.3
+++ /dev/null
-diff -dur dlm-3.99.5.orig/dlm_controld/main.c dlm-3.99.5/dlm_controld/main.c
---- dlm-3.99.5.orig/dlm_controld/main.c 2012-06-21 23:53:56.000000000 +0200
-+++ dlm-3.99.5/dlm_controld/main.c 2012-11-02 09:07:56.348243739 +0100
-@@ -1592,6 +1592,15 @@
- rv = sigaction(SIGTERM, &act, NULL);
- if (rv < 0)
- return -rv;
-+ rv = sigaction(SIGINT, &act, NULL);
-+ if (rv < 0)
-+ return -rv;
-+
-+ memset(&act, 0, sizeof(act));
-+ act.sa_handler = SIG_IGN;
-+ rv = sigaction(SIGHUP, &act, NULL);
-+ if (rv < 0)
-+ return -rv;
-
- memset(&act, 0, sizeof(act));
- act.sa_handler = sigchld_handler;
+++ /dev/null
-diff -dur dlm-3.99.5.orig/dlm_controld/Makefile dlm-3.99.5/dlm_controld/Makefile
---- dlm-3.99.5.orig/dlm_controld/Makefile 2012-11-02 12:02:11.000000000 +0000
-+++ dlm-3.99.5/dlm_controld/Makefile 2012-11-02 12:06:11.064225240 +0000
-@@ -62,7 +62,7 @@
- all: $(LIB_TARGET) $(BIN_TARGET)
-
- $(BIN_TARGET): $(BIN_SOURCE)
-- $(CC) $(BIN_SOURCE) $(BIN_CFLAGS) $(BIN_LDFLAGS) -o $@ -L.
-+ $(CC) $(BIN_SOURCE) $(BIN_CFLAGS) $(BIN_LDFLAGS) -o $@ -L. `pkg-config --cflags --libs libsystemd-daemon`
-
- $(LIB_TARGET): $(LIB_SOURCE)
- $(CC) $^ $(LIB_CFLAGS) $(LIB_LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_SMAJOR)
-diff -dur dlm-3.99.5.orig/dlm_controld/dlm_controld.8 dlm-3.99.5/dlm_controld/dlm_controld.8
---- dlm-3.99.5.orig/dlm_controld/dlm_controld.8 2012-06-21 21:53:56.000000000 +0000
-+++ dlm-3.99.5/dlm_controld/dlm_controld.8 2012-11-02 12:06:38.448225240 +0000
-@@ -23,6 +23,9 @@
- .B --daemon_debug | -D
- enable debugging to stderr and don't fork
-
-+.B --foreground
-+ don't fork
-+
- .B --log_debug | -K
- enable kernel dlm debugging messages
-
-diff -dur dlm-3.99.5.orig/dlm_controld/dlm_daemon.h dlm-3.99.5/dlm_controld/dlm_daemon.h
---- dlm-3.99.5.orig/dlm_controld/dlm_daemon.h 2012-11-02 12:02:11.000000000 +0000
-+++ dlm-3.99.5/dlm_controld/dlm_daemon.h 2012-11-02 12:08:31.937225240 +0000
-@@ -109,6 +109,7 @@
- enable_quorum_lockspace_ind,
- help_ind,
- version_ind,
-+ foreground_ind,
- dlm_options_max,
- };
-
-diff -dur dlm-3.99.5.orig/dlm_controld/main.c dlm-3.99.5/dlm_controld/main.c
---- dlm-3.99.5.orig/dlm_controld/main.c 2012-11-02 12:02:11.000000000 +0000
-+++ dlm-3.99.5/dlm_controld/main.c 2012-11-02 12:08:51.384225241 +0000
-@@ -13,6 +13,7 @@
- #include <linux/netlink.h>
- #include <linux/genetlink.h>
- #include <linux/dlm_netlink.h>
-+#include <systemd/sd-daemon.h>
-
- #include "copyright.cf"
- #include "version.cf"
-@@ -1012,6 +1013,8 @@
- plock_fd = rv;
- plock_ci = client_add(rv, process_plocks, NULL);
-
-+ sd_notify(0, "READY=1");
-+
- for (;;) {
- rv = poll(pollfd, client_maxi + 1, poll_timeout);
- if (rv == -1 && errno == EINTR) {
-@@ -1245,6 +1248,11 @@
- 0, NULL,
- "enable debugging to stderr and don't fork");
-
-+ set_opt_default(foreground_ind,
-+ "foreground", '\0', no_arg,
-+ 0, NULL,
-+ "don't fork");
-+
- set_opt_default(log_debug_ind,
- "log_debug", 'K', no_arg,
- 0, NULL,
-@@ -1562,7 +1570,7 @@
- INIT_LIST_HEAD(&fs_register_list);
- init_daemon();
-
-- if (!opt(daemon_debug_ind)) {
-+ if (!opt(daemon_debug_ind) && !opt(foreground_ind)) {
- if (daemon(0, 0) < 0) {
- perror("daemon error");
- exit(EXIT_FAILURE);
-diff -dur dlm-3.99.5.orig/init/dlm.service dlm-3.99.5/init/dlm.service
---- dlm-3.99.5.orig/init/dlm.service 2012-11-02 12:02:11.000000000 +0000
-+++ dlm-3.99.5/init/dlm.service 2012-11-02 12:03:28.498225239 +0000
-@@ -3,10 +3,11 @@
- After=syslog.target network.target corosync.service sys-kernel-config.mount
-
- [Service]
--Type=forking
-+Type=notify
-+NotifyAccess=main
- EnvironmentFile=/etc/sysconfig/dlm
- ExecStartPre=/sbin/modprobe dlm
--ExecStart=/usr/sbin/dlm_controld $DLM_CONTROLD_OPTS
-+ExecStart=/usr/sbin/dlm_controld --foreground $DLM_CONTROLD_OPTS
- #ExecStopPost=/sbin/modprobe -r dlm
-
- [Install]
Summary: General-purpose distributed lock manager
Summary(pl.UTF-8): Zarządca rozproszonych blokad ogólnego przeznaczenia
Name: dlm
-Version: 3.99.5
-Release: 5
+Version: 4.0.0
+Release: 1
License: LGPL v2.1+, GPL v2
Group: Libraries
Source0: http://people.redhat.com/teigland/%{name}-%{version}.tar.gz
-# Source0-md5: cad4999d0c42000bf5898af34f587728
+# Source0-md5: 2db31a9728ede91a202ff6f3e5accf8d
Source1: %{name}.init
Source2: %{name}.sysconfig
Source3: %{name}.tmpfiles
Source4: dlm.conf
-Patch0: %{name}-link_order.patch
-Patch1: %{name}-after_configfs.patch
-Patch2: %{name}_stonith-build.patch
-Patch3: %{name}-mem_init.patch
-Patch4: %{name}-signals.patch
-Patch5: 0003-dlm_controld-remove-fence_all-from-cli.patch
-Patch6: dlm_stonith-reboot.patch
-Patch7: dlm-startup_notify.patch
+Patch0: %{name}-perms.patch
URL: http://sources.redhat.com/cluster/dlm/
BuildRequires: corosync-devel >= 2.0
%{?with_dlm_stonith:BuildRequires: pacemaker-devel >= 1.1}
%prep
%setup -q
%patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
-%patch6 -p1
-%patch7 -p1
%build
%{__make} \
+++ /dev/null
-diff -dur dlm-3.99.5.org/fence/stonith_helper.c dlm-3.99.5/fence/stonith_helper.c
---- dlm-3.99.5.org/fence/stonith_helper.c 2012-06-21 23:53:56.000000000 +0200
-+++ dlm-3.99.5/fence/stonith_helper.c 2012-11-01 19:47:34.000000000 +0100
-@@ -11,6 +11,7 @@
- #include <string.h>
- #include <unistd.h>
- #include <syslog.h>
-+#include <errno.h>
- #include <pacemaker/crm/stonith-ng.h>
-
- int nodeid;
+++ /dev/null
-commit de04b4e0fa5c6908e3a3d78028e6066a176f80f0
-Author: David Teigland <teigland@redhat.com>
-Date: Mon Nov 5 14:53:23 2012 -0600
-
- stonith-helper: use reboot instead of off
-
- That 0 means reboot was verified by
- Jacek Konieczny <jajcus@jajcus.net>
-
- Signed-off-by: David Teigland <teigland@redhat.com>
-
-diff --git a/fence/stonith_helper.c b/fence/stonith_helper.c
-index 5b384c1..32d2c0d 100644
---- a/fence/stonith_helper.c
-+++ b/fence/stonith_helper.c
-@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
- if (t >= fail_time)
- return 0;
-
-- rv = stonith_api_kick_helper(nodeid, 300, 1);
-+ rv = stonith_api_kick_helper(nodeid, 300, 0);
- if (rv) {
- fprintf(stderr, "kick_helper error %d nodeid %d\n", rv, nodeid);
- openlog("stonith_helper", LOG_CONS | LOG_PID, LOG_DAEMON);