Cluster Project branch, RHEL4, updated. gfs-kernel_2_6_9_76-28-g9133a64
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, RHEL4 has been updated
via 9133a6446a47c56bd735d01d761f0c91f8491fe0 (commit)
from 481965dc9ddb3cbbe06e82ecd507a2b77621206a (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 9133a6446a47c56bd735d01d761f0c91f8491fe0
Author: Ryan O'Hara <[email protected]> Date: Mon Apr 7 11:13:40 2008 -0500
BZ 409391 : fence_scsi and scsi_reserve script no longer use state file for
tracking registered devices (/var/run/scsi_reserve).
-----------------------------------------------------------------------
Summary of changes:
fence/agents/scsi/fence_scsi.pl | 80 ++++---- fence/agents/scsi/fence_scsi_test.pl | 174 ++++++++--------- fence/agents/scsi/scsi_reserve | 356 +++++++++++++++++++--------------- 3 files changed, 328 insertions(+), 282 deletions(-)
fence/agents/scsi/fence_scsi.pl +38 -42
@@ -11,9 +11,6 @@ $_ = $0; s/.*\///; my $pname = $_; -# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and -# "#END_VERSION_GENERATION" It is generated by the Makefile - #BEGIN_VERSION_GENERATION $FENCE_RELEASE_NAME=""; $REDHAT_COPYRIGHT="";
@@ -195,7 +192,6 @@ sub get_key return $key; } - sub get_options_stdin { my $opt;
@@ -232,6 +228,10 @@ sub get_options_stdin { $opt_n = $val; } + elsif ($name eq "nodename") + { + $opt_n = $val; + } elsif ($name eq "verbose") { $opt_v = $val;
@@ -248,7 +248,8 @@ sub get_key_list ($dev) = @_; my ($in, $out, $err); - my $cmd = "sg_persist -d $dev -i -k"; + + my $cmd = "sg_persist -n -d $dev -i -k"; my $pid = open3($in, $out, $err, $cmd) or die "$!\n"; waitpid($pid, 0);
@@ -274,46 +275,36 @@ sub get_key_list return %key_list; } -#sub get_scsi_devices -#{ -# my ($in, $out, $err); -# my $cmd = "lvs --noheadings --separator : -o vg_attr,devices"; -# my $pid = open3($in, $out, $err, $cmd) or die "$!\n"; -# -# waitpid($pid, 0); -# -# die "Unable to execute lvs.\n" if ($?>>8); -# -# while (<$out>) -# { -# chomp; -# print "OUT: $_\n" if $opt_v; -# -# my ($vg_attrs, $device) = split(/:/, $_); -# -# if ($vg_attrs =~ /.*c$/) -# { -# $device =~ s/\(.*\)//; -# push(@volumes, $device); -# } -# } -# -# close($in); -# close($out); -# close($err); -#} - sub get_scsi_devices { - open(FILE, "/var/run/scsi_reserve") or die "$!\n"; + my ($in, $out, $err); + + my $cmd = "vgs --config 'global { locking_type = 0 }'" . + " --noheadings --separator : -o vg_attr,pv_name 2> /dev/null"; + + my $pid = open3($in, $out, $err, $cmd) or die "$!\n"; + + waitpid($pid, 0); - while (<FILE>) + die "Unable to execute lvs.\n" if ($?>>8); + + while (<$out>) { chomp; - push(@volumes, $_); + print "OUT: $_\n" if $opt_v; + + my ($vg_attrs, $device) = split(/:/, $_); + + if ($vg_attrs =~ /.*c$/) + { + $device =~ s/\(.*\)//; + push(@volumes, $device); + } } - close FILE; + close($in); + close($out); + close($err); } sub check_sg_persist
@@ -342,7 +333,7 @@ sub do_register ($dev, $key) = @_; my ($in, $out, $err); - my $cmd = "sg_persist -d $dev -o -G -S $key"; + my $cmd = "sg_persist -n -d $dev -o -G -S $key"; my $pid = open3($in, $out, $err, $cmd) or die "$!\n"; waitpid($pid, 0);
@@ -379,13 +370,18 @@ sub fence_node do_register($dev, $host_key); } + if (!$key_list{$node_key}) + { + next; + } + if ($host_key eq $node_key) { - $cmd = "sg_persist -d $dev -o -G -K $host_key -S 0"; + $cmd = "sg_persist -n -d $dev -o -G -K $host_key -S 0"; } else { - $cmd = "sg_persist -d $dev -o -A -K $host_key -S $node_key -T 5"; + $cmd = "sg_persist -n -d $dev -o -A -K $host_key -S $node_key -T 5"; } my $pid = open3($in, $out, $err, $cmd) or die "$!\n";
@@ -415,7 +411,7 @@ if (@ARGV > 0) { usage if defined $opt_h; version if defined $opt_V; - fail_usage "Unkown parameter." if (@ARGV > 0); + fail_usage "Unknown parameter." if (@ARGV > 0); fail_usage "No '-n' flag specified." unless defined $opt_n;
fence/agents/scsi/fence_scsi_test.pl +86 -88
265 lines not on this page · raw message
fence/agents/scsi/scsi_reserve +204 -152
399 lines not on this page · raw message
hooks/post-receive
--
Cluster Project