This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
cluster: the tag cman_1_0_26 has been created
- From: Chris Feist <cfeist at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Thu, 20 Nov 2008 23:27:57 +0000 (UTC)
- Subject: cluster: the tag cman_1_0_26 has been created
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=88f4194fc7c39dc7564b477dcef6f26f8adfaae9
Commit: 88f4194fc7c39dc7564b477dcef6f26f8adfaae9
Parent: 02746f337c4c3e9bd40c4246f840fb5e7f9f739f
Author: David Teigland <teigland@redhat.com>
AuthorDate: Thu Nov 20 15:06:17 2008 -0600
Committer: David Teigland <teigland@redhat.com>
CommitterDate: Thu Nov 20 15:06:17 2008 -0600
fence_node: use logthread
instead of logsys, and init the lib (and its thread) after calling
into libfence which forks/execs (complicating running threads).
Signed-off-by: David Teigland <teigland@redhat.com>
---
fence/fence_node/Makefile | 5 ++---
fence/fence_node/fence_node.c | 22 ++++++++++++----------
2 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/fence/fence_node/Makefile b/fence/fence_node/Makefile
index 9c707ed..a12c1e6 100644
--- a/fence/fence_node/Makefile
+++ b/fence/fence_node/Makefile
@@ -14,12 +14,11 @@ OBJS= fence_node.o
CFLAGS += -D_FILE_OFFSET_BITS=64
-CFLAGS += -I${ccsincdir} -I${fenceincdir} -I${corosyncincdir}
+CFLAGS += -I${ccsincdir} -I${fenceincdir}
CFLAGS += -I$(S)/../libfenced
CFLAGS += -I${incdir}
-LDFLAGS += -L${ccslibdir} -L${fencelibdir} -lccs -lfence
-LDFLAGS += -L${corosynclibdir} -llogsys
+LDFLAGS += -L${ccslibdir} -L${fencelibdir} -lccs -lfence -llogthread
LDFLAGS += -L../libfenced -lfenced
LDFLAGS += -L${libdir}
diff --git a/fence/fence_node/fence_node.c b/fence/fence_node/fence_node.c
index 32fa229..44dcbc3 100644
--- a/fence/fence_node/fence_node.c
+++ b/fence/fence_node/fence_node.c
@@ -3,7 +3,7 @@
#include <unistd.h>
#include <stdint.h>
#include <string.h>
-#include <corosync/engine/logsys.h>
+#include <liblogthread.h>
#include "libfence.h"
#include "libfenced.h"
@@ -85,26 +85,28 @@ int main(int argc, char *argv[])
if (!victim)
die("no node name specified");
- logsys_init("fence_node",
- LOG_MODE_OUTPUT_STDERR | LOG_MODE_OUTPUT_SYSLOG_THREADED,
- SYSLOGFACILITY, SYSLOGLEVEL, NULL);
-
error = fence_node(victim);
+ logt_init("fence_node", LOG_MODE_OUTPUT_SYSLOG, SYSLOGFACILITY,
+ SYSLOGLEVEL, 0, NULL);
+
if (error) {
- log_printf(LOG_ERR, "Fence of \"%s\" was unsuccessful\n", victim);
+ fprintf(stderr, "Fence of \"%s\" was unsuccessful\n", victim);
+ logt_print(LOG_ERR, "Fence of \"%s\" was unsuccessful\n",
+ victim);
rv = EXIT_FAILURE;
} else {
- log_printf(LOG_NOTICE, "Fence of \"%s\" was successful\n", victim);
+ fprintf(stderr, "Fence of \"%s\" was successful\n", victim);
+ logt_print(LOG_NOTICE, "Fence of \"%s\" was successful\n",
+ victim);
+ rv = EXIT_SUCCESS;
/* Tell fenced what we've done so that it can avoid fencing
this node again if the fence_node() rebooted it. */
fenced_external(victim);
-
- rv = EXIT_SUCCESS;
}
- logsys_exit();
+ logt_exit();
exit(rv);
}