[Cluster-devel] Cluster Project branch, master, updated. cluster-2.99.06-64-ge968098

fabbione at sourceware.org fabbione at sourceware.org
Fri Jul 25 09:12:24 UTC 2008


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".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=e968098fa53e14d1cc9e60c42a4102674ecb51d2

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 <andy at andrewprice.me.uk>
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.
    
    Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>

commit 6a0647657348dd732615b7a0b7d6aad89c85b93a
Author: Andrew Price <andy at andrewprice.me.uk>
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.
    
    Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>

commit 691c72052655c0f7c8142c35145237e122ae6b86
Author: Andrew Price <andy at andrewprice.me.uk>
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.
    
    Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>

-----------------------------------------------------------------------

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%)

diff --git a/fence/agents/scsi/fence_scsi.pl b/fence/agents/scsi/fence_scsi.pl
index b9aea99..d5a8d08 100644
--- a/fence/agents/scsi/fence_scsi.pl
+++ b/fence/agents/scsi/fence_scsi.pl
@@ -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;
 }
diff --git a/fence/agents/scsi/fence_scsi_test.pl b/fence/agents/scsi/fence_scsi_test.pl
index b8e0cc0..357a824 100644
--- a/fence/agents/scsi/fence_scsi_test.pl
+++ b/fence/agents/scsi/fence_scsi_test.pl
@@ -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)
diff --git a/fence/agents/scsi/scsi_reserve b/fence/agents/scsi/scsi_reserve
index 00fc650..3d66991 100644
--- a/fence/agents/scsi/scsi_reserve
+++ b/fence/agents/scsi/scsi_reserve
@@ -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 }' \
diff --git a/rgmanager/init.d/Makefile b/rgmanager/init.d/Makefile
index 3f5104d..5ead895 100644
--- a/rgmanager/init.d/Makefile
+++ b/rgmanager/init.d/Makefile
@@ -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:
diff --git a/rgmanager/init.d/rgmanager.in b/rgmanager/init.d/rgmanager
similarity index 97%
rename from rgmanager/init.d/rgmanager.in
rename to rgmanager/init.d/rgmanager
index 57269ef..6ae333a 100644
--- a/rgmanager/init.d/rgmanager.in
+++ b/rgmanager/init.d/rgmanager
@@ -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




More information about the Cluster-devel mailing list