Cluster Project branch, master, updated. cluster-2.99.06-64-ge968098
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Cluster Project".
The branch, master has been updated
via e968098fa53e14d1cc9e60c42a4102674ecb51d2 (commit)
via 6a0647657348dd732615b7a0b7d6aad89c85b93a (commit)
via 691c72052655c0f7c8142c35145237e122ae6b86 (commit)
from aa5b80fd65ca0ae47bb703a496fa100c5c917328 (commit)Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit e968098fa53e14d1cc9e60c42a4102674ecb51d2
Author: Andrew Price <[email protected]> Date: Fri Jul 25 11:07:26 2008 +0200
fence: port scsi agent to use ccs_tool query and drop XML::LibXML requirement
The new ccs_tool query is able to answer to the queries from fence_scsi*.
Drop the need of XML::LibXML.
Use ccs_tool query directly.
Abstract from the need of parsing cluster.conf that is not the authoritative config file anymore.
Drop unrequire check_config_nodes that's already embedded in the need of cman to run this code.
commit 6a0647657348dd732615b7a0b7d6aad89c85b93a
Author: Andrew Price <[email protected]> Date: Fri Jul 25 11:04:35 2008 +0200
fence: simplify init script
fence_scsi needs cman to run. Verify that cman is running as first thing, before querying for config information that are now stored in cman/aisexec.
cman already guarantees that all nodes have a nodeid. Drop this redundant check.
commit 691c72052655c0f7c8142c35145237e122ae6b86
Author: Andrew Price <[email protected]> Date: Fri Jul 25 11:02:48 2008 +0200
rgmanger: remove check on cluster.conf from rgmanager init script
cluster.conf is not the only authoritative configuration file anymore. LDAP and others could be in place.
Remove the check and allow rgmanager to start.
-----------------------------------------------------------------------
Summary of changes:
fence/agents/scsi/fence_scsi.pl | 22 +++++++++++++++++-----
fence/agents/scsi/fence_scsi_test.pl | 26 +++++---------------------
fence/agents/scsi/scsi_reserve | 20 ++++++--------------
rgmanager/init.d/Makefile | 10 +---------
rgmanager/init.d/{rgmanager.in => rgmanager} | 2 --
5 files changed, 29 insertions(+), 51 deletions(-)
rename rgmanager/init.d/{rgmanager.in => rgmanager} (97%)fence/agents/scsi/fence_scsi.pl +17 -5
@@ -1,7 +1,6 @@ #!/usr/bin/perl use Getopt::Std; -use XML::LibXML; use IPC::Open3; use POSIX;
@@ -97,12 +96,25 @@ sub get_node_id { ($node)=@_; - my $xml = XML::LibXML->new(); - my $tree = $xml->parse_file("/etc/cluster/cluster.conf"); + my $node_id; - my $xpath = "//cluster/clusternodes/clusternode[\@name='$node']/\@nodeid"; + my ($in, $out, $err); + my $cmd = "ccs_tool query /cluster/clusternodes/clusternode[\@name=\\\"$node\\\"]/\@nodeid"; + + my $pid = open3($in, $out, $err, $cmd) or die "$!\n"; + + waitpid($pid, 0); + + die "Unable to execute ccs_tool.\n" if ($?>>8); - my $node_id = $tree->findvalue($xpath); + while (<$out>) { + chomp; + $node_id = $_; + } + + close($in); + close($out); + close($err); return $node_id; }
fence/agents/scsi/fence_scsi_test.pl +5 -21
@@ -2,7 +2,6 @@ use POSIX; use IPC::Open3; -use XML::LibXML; use Getopt::Std; my @devices;
@@ -110,25 +109,14 @@ sub test_devices sub check_config_fence { - my $xml = XML::LibXML->new(); - my $tree = $xml->parse_file("/etc/cluster/cluster.conf"); - my $root = "//cluster/fencedevices/fencedevice"; - - my $xpath_fence = "count(${root}[\@agent='fence_scsi'])"; - - return ( ! $tree->findvalue($xpath_fence)); -} + my ($in, $out, $err); + my $cmd = "ccs_tool query /cluster/fencedevices/fencedevice[\@agent=\\\"fence_scsi\\\"]"; -sub check_config_nodes -{ - my $xml = XML::LibXML->new(); - my $tree = $xml->parse_file("/etc/cluster/cluster.conf"); - my $root = "//cluster/clusternodes/clusternode"; + my $pid = open3($in, $out, $err, $cmd) or die "$!\n"; - my $xpath_name = "count(${root}/\@name)"; - my $xpath_nodeid = "count(${root}/\@nodeid)"; + waitpid($pid, 0); - return ($tree->findvalue($xpath_name) != $tree->findvalue($xpath_nodeid)); + return ($?>>8); } sub print_results
@@ -223,10 +211,6 @@ if ($opt_t) { exit check_config_fence; } - if ($opt_t eq "nodes") - { - exit check_config_nodes; - } } if (!$opt_c && !$opt_s && !$opt_t)
fence/agents/scsi/scsi_reserve +6 -14
@@ -23,19 +23,19 @@ if [ -f /etc/sysconfig/scsi_reserve ] ; then . /etc/sysconfig/scsi_reserve fi -# check if cluster is configured for fence_scsi +# check that cman is running # -if ! fence_scsi_test -t fence ; then +if ! cman_tool status &> /dev/null ; then logger -t scsi_reserve \ - "[error] cluster not configured for scsi reservations" + "[error] cman does not appear to be running" exit 1 fi -# check for nodeids in config file +# check if cluster is configured for fence_scsi # -if ! fence_scsi_test -t nodes ; then +if ! fence_scsi_test -t fence ; then logger -t scsi_reserve \ - "[error] cluster must define nodeid for all nodes" + "[error] cluster not configured for scsi reservations" exit 1 fi
@@ -47,14 +47,6 @@ if ! sg_persist -V &> /dev/null ; then exit 1 fi -# check that cman is running -# -if ! cman_tool status &> /dev/null ; then - logger -t scsi_reserve \ - "[error] cman does not appear to be running" - exit 1 -fi - # get physical volumes (devices) that are part of cluster volumes # scsi_devices=$( vgs --config 'global { locking_type = 0 }' \
rgmanager/init.d/Makefile +1 -9
@@ -2,20 +2,12 @@ TARGET= rgmanager INITDT=$(TARGET) -all: $(TARGET) +all: include ../../make/defines.mk -include $(OBJDIR)/make/clean.mk include $(OBJDIR)/make/install.mk include $(OBJDIR)/make/uninstall.mk -$(TARGET): - cat $(S)/$(TARGET).in | sed \ - -e 's#@CONFDIR@#${CONFDIR}#g' \ - -e 's#@CONFFILE@#${CONFFILE}#g' \ - > $(TARGET) - chmod 755 $(TARGET) - clean: generalclean check:
rgmanager/init.d/rgmanager renamed from rgmanager/init.d/rgmanager.in +0 -2
@@ -28,7 +28,6 @@ export PATH ID="Cluster Service Manager" RGMGRD="clurgmgrd" -CFG_FILE="@CONFDIR@/@CONFFILE@" LOG_ERR=3 LOG_WARNING=4
@@ -91,7 +90,6 @@ case $1 in echo "Cannot start $ID: Networking not configured" exit 1 fi - [ -f "$CFG_FILE" ] || exit 0 echo -n $"Starting $ID: " daemon $RGMGRD $RGMGR_OPTS
hooks/post-receive
--
Cluster Project
Quoted 1 line · fabbione at sourceware.org
Author: Andrew Price <[email protected]>
Hem.. sorry guys.. stupid mistake (my side). Andrew has nothing to do with those patches.
I will revert and apply them correctly.
Fabio
--
I'm going to make him an offer he can't refuse.