diff options
author | Christian Zoffoli <xmerlin@gentoo.org> | 2006-07-15 16:19:57 +0000 |
---|---|---|
committer | Christian Zoffoli <xmerlin@gentoo.org> | 2006-07-15 16:19:57 +0000 |
commit | 2109eb1cd5ce7d3c9eac39285ae80b615e4ee476 (patch) | |
tree | b8e077d4fea38ad0ec22e478e540df191851e40d /sys-cluster | |
parent | - 2.6.16 bumped for CVE-2006-3626 ; digest fix for 2.4.32-r6 ; removed old cr... (diff) | |
download | gentoo-2-2109eb1cd5ce7d3c9eac39285ae80b615e4ee476.tar.gz gentoo-2-2109eb1cd5ce7d3c9eac39285ae80b615e4ee476.tar.bz2 gentoo-2-2109eb1cd5ce7d3c9eac39285ae80b615e4ee476.zip |
Added fence_xen, closed bug #124345.
(Portage version: 2.1-r1)
Diffstat (limited to 'sys-cluster')
-rw-r--r-- | sys-cluster/fence/ChangeLog | 7 | ||||
-rw-r--r-- | sys-cluster/fence/fence-1.02.00-r1.ebuild | 5 | ||||
-rw-r--r-- | sys-cluster/fence/fence-1.02.00.ebuild | 5 | ||||
-rw-r--r-- | sys-cluster/fence/files/fence_xen | 172 |
4 files changed, 186 insertions, 3 deletions
diff --git a/sys-cluster/fence/ChangeLog b/sys-cluster/fence/ChangeLog index 6297bf58f235..e83dcee4a4f5 100644 --- a/sys-cluster/fence/ChangeLog +++ b/sys-cluster/fence/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for sys-cluster/fence # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/fence/ChangeLog,v 1.24 2006/07/14 13:30:58 xmerlin Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/fence/ChangeLog,v 1.25 2006/07/15 16:19:57 xmerlin Exp $ + + 15 Jul 2006; Christian Zoffoli <xmerlin@gentoo.org> +files/fence_xen, + fence-1.02.00.ebuild, fence-1.02.00-r1.ebuild: + Added fence_xen, closed bug #124345, thanks to + Christopher G. Stach II <cgs@ldsys.net> for pointing it. 14 Jul 2006; Christian Zoffoli <xmerlin@gentoo.org> fence-1.02.00-r1.ebuild: diff --git a/sys-cluster/fence/fence-1.02.00-r1.ebuild b/sys-cluster/fence/fence-1.02.00-r1.ebuild index b29d66aea0b2..b1f1bdebe206 100644 --- a/sys-cluster/fence/fence-1.02.00-r1.ebuild +++ b/sys-cluster/fence/fence-1.02.00-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/fence/fence-1.02.00-r1.ebuild,v 1.2 2006/07/14 13:30:58 xmerlin Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/fence/fence-1.02.00-r1.ebuild,v 1.3 2006/07/15 16:19:57 xmerlin Exp $ inherit eutils @@ -40,6 +40,9 @@ src_compile() { src_install() { make DESTDIR=${D} install || die + into / + dosbin ${FILESDIR}/${PN}_xen || die + newinitd ${FILESDIR}/${PN}d.rc ${PN}d || die newconfd ${FILESDIR}/${PN}d.conf ${PN}d || die } diff --git a/sys-cluster/fence/fence-1.02.00.ebuild b/sys-cluster/fence/fence-1.02.00.ebuild index a71a61c97f1e..18693aa6a6ee 100644 --- a/sys-cluster/fence/fence-1.02.00.ebuild +++ b/sys-cluster/fence/fence-1.02.00.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/fence/fence-1.02.00.ebuild,v 1.2 2006/07/13 10:44:11 xmerlin Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/fence/fence-1.02.00.ebuild,v 1.3 2006/07/15 16:19:57 xmerlin Exp $ MY_P="cluster-${PV}" @@ -30,6 +30,9 @@ src_compile() { src_install() { make DESTDIR=${D} install || die + into / + dosbin ${FILESDIR}/fence_xen || die + newinitd ${FILESDIR}/${PN}d.rc ${PN}d || die newconfd ${FILESDIR}/${PN}d.conf ${PN}d || die } diff --git a/sys-cluster/fence/files/fence_xen b/sys-cluster/fence/files/fence_xen new file mode 100644 index 000000000000..27ab34a67758 --- /dev/null +++ b/sys-cluster/fence/files/fence_xen @@ -0,0 +1,172 @@ +#!/usr/bin/perl + +############################################################################### +############################################################################### +## +## Copyright (C) 2005 Red Hat, Inc. All rights reserved. +## +## This copyrighted material is made available to anyone wishing to use, +## modify, copy, or redistribute it subject to the terms and conditions +## of the GNU General Public License v.2. +## +############################################################################### +############################################################################### + +use Getopt::Std; + +# Get the program name from $0 and strip directory names +$_=$0; +s/.*\///; +my $pname = $_; + + +# Default is to use ssh for connection to the host +# for this to be effective you'll need to have an ssh key on the VMs +# that can log in to the host without a passphrase. +# If you device to use rsh then you'll need to edit /root/.rhosts +# +# Also note that you'll need to set /proc/sys/kernel/sysrq to "1" in +# the VMs for this to work at all. +# +$opt_c = "ssh"; +$opt_u = "root"; + +# 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="DEVEL.1105353156"; +$REDHAT_COPYRIGHT=("Copyright (C) Red Hat, Inc. 2005 All rights reserved."); +$BUILD_DATE="(built Mon Jan 10 10:35:41 GMT 2005)"; +#END_VERSION_GENERATION + +sub usage +{ + print "Usage:\n"; + print "\n"; + print "$pname [options]\n"; + print "\n"; + print "Options:\n"; + print " -h This help message\n"; + print " -s <ip> IP address or hostname of host system\n"; + print " -d <domain> Domain name of system to fence\n"; + print " -u <name> User name (default root)\n"; + print " -c <cmd> Command to log into host (default ssh) \n"; + + exit 0; +} + +sub fail +{ + ($msg)=@_; + print $msg."\n" unless defined $opt_q; + + if (defined $t) + { + # make sure we don't get stuck in a loop due to errors + $t->errmode('return'); + + logout() if $logged_in; + $t->close + } + exit 1; +} + +sub fail_usage +{ + ($msg)=@_; + print STDERR $msg."\n" if $msg; + print STDERR "Please use '-h' for usage.\n"; + exit 1; +} + +sub version +{ + print "$pname $FENCE_RELEASE_NAME $BUILD_DATE\n"; + print "$SISTINA_COPYRIGHT\n" if ( $SISTINA_COPYRIGHT ); + exit 0; +} + + + + +sub get_options_stdin +{ + my $opt; + my $line = 0; + while( defined($in = <>) ) + { + $_ = $in; + chomp; + + # strip leading and trailing whitespace + s/^\s*//; + s/\s*$//; + + # skip comments + next if /^#/; + + $line+=1; + $opt=$_; + next unless $opt; + + ($name,$val)=split /\s*=\s*/, $opt; + + if ( $name eq "" ) + { + print STDERR "parse error: illegal name in option $line\n"; + exit 2; + } + # DO NOTHING -- this field is used by fenced + elsif ($name eq "agent" ) + { + } + elsif ($name eq "host" ) + { + $opt_s = $val; + } + elsif ($name eq "domain" ) + { + $opt_d = $val; + } + elsif ($name eq "user" ) + { + $opt_u = $val; + } + elsif ($name eq "cmd" ) + { + $opt_c = $val; + } + # Maybe password... + # Excess name/vals will fail + else + { + fail "parse error: unknown option \"$opt\""; + } + } +} + + +### MAIN ####################################################### +if (@ARGV > 0) { + getopts("hs:d:u:c:vV") || fail_usage ; + + usage if defined $opt_h; + version if defined $opt_V; + + fail_usage "Unknown parameter." if (@ARGV > 0); + + fail_usage "No '-d' flag specified." unless defined $opt_d; + fail_usage "No '-s' flag specified." unless defined $opt_s; + + } else { + get_options_stdin(); + + fail "failed: no host system name" unless defined $opt_s; + fail "failed: no domain to fence" unless defined $opt_d; + + } + +exit system ("$opt_c -l $opt_u $opt_s xm sysrq $opt_d b"); + + |