cluster: STABLE3 - cman init: add options to drive config validation in cman_tool
Fabio M. Di Nitto
fabbione at fedoraproject.org
Fri Oct 2 11:11:55 UTC 2009
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=1ad72774e4139fbc7163ae35bbde3fbf41615dc7
Commit: 1ad72774e4139fbc7163ae35bbde3fbf41615dc7
Parent: 137c94155c81106ad1460ae55a22b1a898524167
Author: Fabio M. Di Nitto <fdinitto at redhat.com>
AuthorDate: Fri Oct 2 13:11:27 2009 +0200
Committer: Fabio M. Di Nitto <fdinitto at redhat.com>
CommitterDate: Fri Oct 2 13:11:27 2009 +0200
cman init: add options to drive config validation in cman_tool
Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>
---
cman/init.d/cman.in | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index aa8a585..055abda 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -154,6 +154,16 @@ fi
# openaisparser - use internal openais config file parser.
[ -n "$CONFIG_LOADER" ] && cman_join_opts+=" -C $CONFIG_LOADER"
+# CONFIG_VALIDATION -- select default config validation behaviour
+# This can be:
+# FAIL - Use a very strict checking. The config will not be loaded if there
+# for any kind of warnings/errors.
+# WARN - Same as FAIL, but will allow the config to load (this is temporary
+# the default behaviour)
+# NONE - Disable config validation. Highly discouraged.
+[ -z "$CONFIG_VALIDATION" ] && CONFIG_VALIDATION=WARN
+cman_join_opts+=" -D$CONFIG_VALIDATION"
+
# CMAN_LEAVE_OPTS -- allows extra options to be passed to cman_tool when leave
# operation is performed.
[ -n "$CMAN_LEAVE_OPTS" ] && cman_leave_opts="$CMAN_LEAVE_OPTS"
@@ -522,6 +532,9 @@ start_cman()
ret=1
else
ret=0
+ if [ "$CONFIG_VALIDATION" = "WARN" ] && [ -s $tmpfile ]; then
+ cat $tmpfile >&2
+ fi
fi
rm -f $tmpfile
More information about the cluster-commits
mailing list