From mboxrd@z Thu Jan 1 00:00:00 1970 From: kupcevic@sourceware.org Date: 5 Oct 2006 17:38:03 -0000 Subject: [Cluster-devel] conga ./clustermon.spec.in.in ricci/docs/clust ... Message-ID: <20061005173803.18482.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: conga Changes by: kupcevic at sourceware.org 2006-10-05 17:38:01 Modified files: . : clustermon.spec.in.in ricci/docs : cluster_api.html ricci/modules/cluster: ClusterConf.cpp ClusterConf.h ClusterModule.cpp ClusterStatus.cpp ClusterStatus.h Log message: cluster module: add purge_conf argument to stop_node() (bz202314) Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/clustermon.spec.in.in.diff?cvsroot=cluster&r1=1.15&r2=1.16 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/docs/cluster_api.html.diff?cvsroot=cluster&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/ClusterConf.cpp.diff?cvsroot=cluster&r1=1.6&r2=1.7 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/ClusterConf.h.diff?cvsroot=cluster&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/ClusterModule.cpp.diff?cvsroot=cluster&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/ClusterStatus.cpp.diff?cvsroot=cluster&r1=1.11&r2=1.12 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/ClusterStatus.h.diff?cvsroot=cluster&r1=1.3&r2=1.4 --- conga/clustermon.spec.in.in 2006/10/04 16:32:40 1.15 +++ conga/clustermon.spec.in.in 2006/10/05 17:38:01 1.16 @@ -194,6 +194,9 @@ %changelog +* Fri Oct 06 2006 Stanko Kupcevic 0.8-18 +- Add purge_conf argument to stop_node modcluster call (bz202314) + * Wed Oct 04 2006 Stanko Kupcevic 0.8-17 - Version bump --- conga/ricci/docs/cluster_api.html 2006/06/20 19:37:22 1.3 +++ conga/ricci/docs/cluster_api.html 2006/10/05 17:38:01 1.4 @@ -125,9 +125,12 @@

Stop cluster infrastructure on this node (also, disable daemons' boot startup).
It is not an error to stop already stopped node.

-

Input variables:
- ???cluster_shutdown??? (boolean) ??? +

Input variables: +
- ???cluster_shutdown??? (boolean) ??? optional, default ???false???, cluster is shutting down (don't - bounce services around)

+ bounce services around) +
- ???purge_conf??? (boolean) ??? + optional, default ???false???, delete cluster.conf; start_node() cannot be called any more, without calling set_cluster.conf() first

No output variables.

On failure:
- No special errors defined, only generic ones @@ -148,4 +151,4 @@



- \ No newline at end of file + --- conga/ricci/modules/cluster/ClusterConf.cpp 2006/09/26 00:54:26 1.6 +++ conga/ricci/modules/cluster/ClusterConf.cpp 2006/10/05 17:38:01 1.7 @@ -123,6 +123,12 @@ } } +void +ClusterConf::purge_conf() +{ + unlink(CLUSTER_CONF_PATH.c_str()); +} + bool ClusterConf::is_gulm(const XMLObject& cluster_conf) { --- conga/ricci/modules/cluster/ClusterConf.h 2006/03/30 19:53:32 1.2 +++ conga/ricci/modules/cluster/ClusterConf.h 2006/10/05 17:38:01 1.3 @@ -33,6 +33,7 @@ static XMLObject get(); static void set(const XMLObject& xml, bool propagate=true); + static void purge_conf(); static bool is_gulm(const XMLObject& cluster_conf); static bool is_cman(const XMLObject& cluster_conf); --- conga/ricci/modules/cluster/ClusterModule.cpp 2006/08/10 22:53:08 1.4 +++ conga/ricci/modules/cluster/ClusterModule.cpp 2006/10/05 17:38:01 1.5 @@ -224,15 +224,20 @@ stop_node(const VarMap& args) { bool cluster_shutdown = false; + bool purge_conf = false; try { VarMap::const_iterator iter = args.find("cluster_shutdown"); if (iter != args.end()) cluster_shutdown = iter->second.get_bool(); + iter = args.find("purge_conf"); + if (iter != args.end()) + purge_conf = iter->second.get_bool(); } catch ( String e ) { throw APIerror(e); } - Cluster::stop_node(cluster_shutdown); + Cluster::stop_node(cluster_shutdown, + purge_conf); VarMap ret; return ret; --- conga/ricci/modules/cluster/ClusterStatus.cpp 2006/08/15 00:16:30 1.11 +++ conga/ricci/modules/cluster/ClusterStatus.cpp 2006/10/05 17:38:01 1.12 @@ -111,11 +111,12 @@ void Cluster::start_node(bool cluster_startup) { + XMLObject cluster_conf(ClusterConf::get()); // bailout if cluster.conf not present XMLObject stat = status(); if (stat.get_attr("cluster_version") == "4") { - XMLObject cluster_conf(ClusterConf::get()); run_initd("ccsd", true, false); + cluster_conf = ClusterConf::get(); // ccsd should bring newest cluster.conf if (ClusterConf::is_cman(cluster_conf)) try { run_initd("cman", true, true); @@ -192,7 +193,7 @@ } bool use_qdisk = false; - XMLObject cluster_conf(ClusterConf::get()); // ccsd should bring newest cluster.conf + cluster_conf = ClusterConf::get(); // ccsd should bring newest cluster.conf for (list::const_iterator iter = cluster_conf.children().begin(); iter != cluster_conf.children().end(); iter++) @@ -223,7 +224,8 @@ } void -Cluster::stop_node(bool cluster_shutdown) +Cluster::stop_node(bool cluster_shutdown, + bool purge_conf) { XMLObject stat = status(); @@ -279,6 +281,10 @@ } else { throw String("unsupported cluster version ") + stat.get_attr("cluster_version"); } + + if (purge_conf) { + ClusterConf::purge_conf(); + } } --- conga/ricci/modules/cluster/ClusterStatus.h 2006/06/20 19:37:23 1.3 +++ conga/ricci/modules/cluster/ClusterStatus.h 2006/10/05 17:38:01 1.4 @@ -33,7 +33,8 @@ static XMLObject status(); static void start_node(bool cluster_startup = false); - static void stop_node(bool cluster_shutdown = false); + static void stop_node(bool cluster_shutdown = false, + bool purge_conf = false); };