* [Cluster-devel] cluster/rgmanager/src clulib/clulog.c daemons/ ...
@ 2007-01-26 20:47 lhh
0 siblings, 0 replies; only message in thread
From: lhh @ 2007-01-26 20:47 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: STABLE
Changes by: lhh at sourceware.org 2007-01-26 20:47:17
Modified files:
rgmanager/src/clulib: clulog.c
rgmanager/src/daemons: Makefile reslist.c resrules.c
rgmanager/src/resources: ocf-shellfuncs
Log message:
Merge from RHEL4 branch
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/clulib/clulog.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.2.2.1.6.4&r2=1.2.2.1.6.5
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/Makefile.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.6.2.2.6.2&r2=1.6.2.2.6.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/reslist.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.6.2.4.6.3&r2=1.6.2.4.6.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/resrules.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.9.2.2.6.2&r2=1.9.2.2.6.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/ocf-shellfuncs.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.2.2.4&r2=1.2.2.5
--- cluster/rgmanager/src/clulib/clulog.c 2007/01/22 23:10:01 1.2.2.1.6.4
+++ cluster/rgmanager/src/clulib/clulog.c 2007/01/26 20:47:16 1.2.2.1.6.5
@@ -20,7 +20,7 @@
/** @file
* Library routines for communicating with the logging daemon.
*
- * $Id: clulog.c,v 1.2.2.1.6.4 2007/01/22 23:10:01 lhh Exp $
+ * $Id: clulog.c,v 1.2.2.1.6.5 2007/01/26 20:47:16 lhh Exp $
*
* Author: Jeff Moyer <moyer@missioncriticallinux.com>
*/
@@ -50,7 +50,7 @@
#include <string.h>
-static const char *version __attribute__ ((unused)) = "$Revision: 1.2.2.1.6.4 $";
+static const char *version __attribute__ ((unused)) = "$Revision: 1.2.2.1.6.5 $";
#ifdef DEBUG
#include <assert.h>
--- cluster/rgmanager/src/daemons/Makefile 2006/06/16 20:07:46 1.6.2.2.6.2
+++ cluster/rgmanager/src/daemons/Makefile 2007/01/26 20:47:16 1.6.2.2.6.3
@@ -59,7 +59,7 @@
# packages should run 'make check' as part of the build process.
#
rg_test: rg_locks-noccs.o test-noccs.o reslist-noccs.o \
- resrules.o restree-noccs.o fo_domain-noccs.o
+ resrules-noccs.o restree-noccs.o fo_domain-noccs.o
$(CC) -o $@ $^ $(INCLUDE) $(CFLAGS) -llalloc $(LDFLAGS)
clurmtabd: clurmtabd.o clurmtabd_lib.o
--- cluster/rgmanager/src/daemons/reslist.c 2007/01/22 23:10:01 1.6.2.4.6.3
+++ cluster/rgmanager/src/daemons/reslist.c 2007/01/26 20:47:16 1.6.2.4.6.4
@@ -29,6 +29,9 @@
#include <list.h>
#include <reslist.h>
#include <pthread.h>
+#ifndef NO_CCS
+#include <clulog.h>
+#endif
char *attr_value(resource_node_t *node, char *attrname);
@@ -339,12 +342,29 @@
/*
Unique/primary is not unique
*/
- printf("Unique/primary not unique "
- "type %s, %s=%s\n",
+#ifdef NO_CCS
+ printf("Error: "
+ "%s attribute collision. "
+ "type=%s attr=%s value=%s\n",
+ (newres->r_attrs[x].ra_flags&
+ RA_PRIMARY)?"Primary":
+ "Unique",
+ newres->r_rule->rr_type,
+ newres->r_attrs[x].ra_name,
+ newres->r_attrs[x].ra_value
+ );
+#else
+ clulog(LOG_ERR,
+ "%s attribute collision. "
+ "type=%s attr=%s value=%s\n",
+ (newres->r_attrs[x].ra_flags&
+ RA_PRIMARY)?"Primary":
+ "Unique",
newres->r_rule->rr_type,
newres->r_attrs[x].ra_name,
newres->r_attrs[x].ra_value
);
+#endif
return -1;
}
break;
@@ -743,8 +763,15 @@
break;
if (store_resource(reslist, newres) != 0) {
+#ifdef NO_CCS
printf("Error storing %s resource\n",
newres->r_rule->rr_type);
+#else
+ clulog(LOG_ERR,
+ "Error storing %s resource\n",
+ newres->r_rule->rr_type);
+#endif
+
destroy_resource(newres);
}
--- cluster/rgmanager/src/daemons/resrules.c 2007/01/22 23:10:01 1.9.2.2.6.2
+++ cluster/rgmanager/src/daemons/resrules.c 2007/01/26 20:47:16 1.9.2.2.6.3
@@ -31,7 +31,9 @@
#include <pthread.h>
#include <dirent.h>
#include <libgen.h>
+#ifndef NO_CCS
#include <clulog.h>
+#endif
/**
@@ -49,14 +51,25 @@
list_do(rulelist, curr) {
if (!strcmp(newrule->rr_type, curr->rr_type)) {
+#ifdef NO_CCS
fprintf(stderr, "Error storing %s: Duplicate\n",
newrule->rr_type);
+#else
+ clulog(LOG_ERR, "Error storing %s: Duplicate\n",
+ newrule->rr_type);
+#endif
return -1;
}
if (newrule->rr_root && curr->rr_root) {
+#ifdef NO_CCS
fprintf(stderr, "Error storing %s: root "
"resource type %s exists already\n",
newrule->rr_type, curr->rr_type);
+#else
+ clulog(LOG_ERR, "Error storing %s: root "
+ "resource type %s exists already\n",
+ newrule->rr_type, curr->rr_type);
+#endif
return -1;
}
@@ -988,9 +1001,15 @@
break;
if (!strcasecmp(type, "action")) {
+#ifdef NO_CCS
fprintf(stderr,
"Error: Resource type '%s' is reserved",
type);
+#else
+ clulog(LOG_ERR,
+ "Error: Resource type '%s' is reserved",
+ type);
+#endif
free(type);
break;
}
--- cluster/rgmanager/src/resources/ocf-shellfuncs 2007/01/22 23:10:01 1.2.2.4
+++ cluster/rgmanager/src/resources/ocf-shellfuncs 2007/01/26 20:47:16 1.2.2.5
@@ -1,10 +1,10 @@
#
-# $Id: ocf-shellfuncs,v 1.2.2.4 2007/01/22 23:10:01 lhh Exp $
+# $Id: ocf-shellfuncs,v 1.2.2.5 2007/01/26 20:47:16 lhh Exp $
#
# Common helper functions for the OCF Resource Agents supplied by
# heartbeat.
#
-# Copyright (c) 2004 SUSE LINUX AG, Lars Marowsky-Br?e
+# Copyright (c) 2004 SUSE LINUX AG, Lars Marowsky-Br???e
# All Rights Reserved.
#
# Modified for linux-cluster 2005 by Lon Hohberger
@@ -175,7 +175,7 @@
pretty_echo $__OCF_PRIO "$__OCF_MSG"
clulog -p $__LOG_PID -n $__LOG_NAME \
- -l $__OCF_PRIO_N -s $__OCF_PRIO_N "$__OCF_MSG"
+ -s $__OCF_PRIO_N "$__OCF_MSG"
}
__ocf_set_defaults "$@"
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-01-26 20:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-26 20:47 [Cluster-devel] cluster/rgmanager/src clulib/clulog.c daemons/ lhh
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).