[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] Cluster Project branch, STABLE2, updated. cluster-2.03.03-17-gd8569c4



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=d8569c4b2f8fef25ea5b344ece79f4cc12e04fb4

The branch, STABLE2 has been updated
       via  d8569c4b2f8fef25ea5b344ece79f4cc12e04fb4 (commit)
       via  541d5fd690e5cce0eef140fd770ff893599f488a (commit)
       via  09dc160a34fe3a37e7209a41a80a60d759d75354 (commit)
       via  99e8ffb63960751e7170463defe80abdb730b47f (commit)
       via  5a0286041f0c0939fca217b0872ed523ed63859b (commit)
       via  8a11e709cee3a80f3da3755a92f7e80d6da45c1f (commit)
       via  1f3fc33a88118c6327e898825817a558dacc07be (commit)
       via  31d30b16d55c8919d8d0e90a3432095eba1ff2d4 (commit)
       via  3612f4c9db1073539bf2c1bc86c641be7f7aa3c2 (commit)
      from  dd97ff24427d02a2aea0057345cf8067334dcb3b (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 d8569c4b2f8fef25ea5b344ece79f4cc12e04fb4
Author: Fabio M. Di Nitto <fdinitto redhat com>
Date:   Mon Jun 9 07:03:58 2008 +0200

    [GNBD/FENCE] Move fence_gnbd agent where it belongs
    
    Signed-off-by: Fabio M. Di Nitto <fdinitto redhat com>

commit 541d5fd690e5cce0eef140fd770ff893599f488a
Author: Ryan McCabe <rmccabe redhat com>
Date:   Wed May 28 16:28:34 2008 -0400

    fence: fixes and cleanups to fencing.py library
    
    - Do not report failure if a node is successfully powered off,
      but fails to power on.
    
    - Change 'pass' to 'continue' so that comments and blank lines
      from stdin are ignored.
    
    - Use the full path to ssh and telnet when executing the binaries.

commit 09dc160a34fe3a37e7209a41a80a60d759d75354
Author: Fabio M. Di Nitto <fdinitto redhat com>
Date:   Thu May 22 16:43:27 2008 +0200

    [CCS] Use absolute path for queries
    
    * It is more efficient
    * It is a well-defined location
    
    Signed-off-by: Fabio M. Di Nitto <fdinitto redhat com>

commit 99e8ffb63960751e7170463defe80abdb730b47f
Author: Lon Hohberger <lhh redhat com>
Date:   Thu May 22 10:33:12 2008 -0400

    [rgmanager] Use /cluster/rm instead of //rm
    
     * It is more efficient
     * It is a well-defined location

commit 5a0286041f0c0939fca217b0872ed523ed63859b
Author: Fabio M. Di Nitto <fdinitto redhat com>
Date:   Thu May 22 09:55:31 2008 +0200

    [BUILD] Plugin the new shiny fence_ifmib agent
    
    Signed-off-by: Fabio M. Di Nitto <fdinitto redhat com>

commit 8a11e709cee3a80f3da3755a92f7e80d6da45c1f
Author: Fabio M. Di Nitto <fdinitto redhat com>
Date:   Thu May 22 09:30:58 2008 +0200

    [FENCE] Fix ifmib README to report the right fence agent
    
    Signed-off-by: Fabio M. Di Nitto <fdinitto redhat com>

commit 1f3fc33a88118c6327e898825817a558dacc07be
Author: Fabio M. Di Nitto <fdinitto redhat com>
Date:   Thu May 22 09:28:44 2008 +0200

    [FENCE] Fix copyright header for fence_ifmib manpage
    
    Signed-off-by: Fabio M. Di Nitto <fdinitto redhat com>

commit 31d30b16d55c8919d8d0e90a3432095eba1ff2d4
Author: Ross Vandegrift <ross kallisti us>
Date:   Thu May 22 09:25:32 2008 +0200

    [FENCE] Add fence_ifmib new agent
    
    Many thanks to Ross Vandegrift for this submission.
    
    Signed-off-by: Fabio M. Di Nitto <fdinitto redhat com>

commit 3612f4c9db1073539bf2c1bc86c641be7f7aa3c2
Author: Fabio M. Di Nitto <fdinitto redhat com>
Date:   Wed May 21 10:38:10 2008 +0200

    [GFS2] Use proper include dir for libvolume_id
    
    Signed-off-by: Fabio M. Di Nitto <fdinitto redhat com>

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

Summary of changes:
 ccs/ccs_tool/update.c                              |    6 +-
 ccs/daemon/misc.c                                  |    7 +-
 .../fence_gnbd => fence/agents/gnbd}/Makefile      |    3 +-
 .../tools/fence_gnbd => fence/agents/gnbd}/main.c  |    0 
 fence/agents/{apc => ifmib}/Makefile               |    2 +-
 fence/agents/ifmib/README                          |   45 ++++
 fence/agents/ifmib/fence_ifmib.py                  |  221 ++++++++++++++++++++
 fence/agents/lib/fencing.py.py                     |   37 ++--
 fence/man/Makefile                                 |    2 +
 {gnbd => fence}/man/fence_gnbd.8                   |    0 
 fence/man/fence_ifmib.8                            |   69 ++++++
 gfs2/mkfs/Makefile                                 |    1 +
 gnbd/man/Makefile                                  |    3 +-
 gnbd/tools/Makefile                                |    2 +-
 rgmanager/include/reslist.h                        |    2 +-
 15 files changed, 369 insertions(+), 31 deletions(-)
 rename {gnbd/tools/fence_gnbd => fence/agents/gnbd}/Makefile (94%)
 rename {gnbd/tools/fence_gnbd => fence/agents/gnbd}/main.c (100%)
 copy fence/agents/{apc => ifmib}/Makefile (97%)
 create mode 100644 fence/agents/ifmib/README
 create mode 100644 fence/agents/ifmib/fence_ifmib.py
 rename {gnbd => fence}/man/fence_gnbd.8 (100%)
 create mode 100644 fence/man/fence_ifmib.8

diff --git a/ccs/ccs_tool/update.c b/ccs/ccs_tool/update.c
index 062c8b1..ef49d7a 100644
--- a/ccs/ccs_tool/update.c
+++ b/ccs/ccs_tool/update.c
@@ -67,7 +67,7 @@ static int get_doc_version(xmlDocPtr ldoc)
     goto fail;
   }
 
-  obj = xmlXPathEvalExpression((xmlChar *)"//cluster/@config_version", ctx);
+  obj = xmlXPathEvalExpression((xmlChar *)"/cluster/@config_version", ctx);
 
   if (!obj || !obj->nodesetval || (obj->nodesetval->nodeNr != 1)) {
     fprintf(stderr, "Error while retrieving config_version.\n");
@@ -150,7 +150,7 @@ int update(char *location)
     return desc;
   }
 
-  if ((error = ccs_get(desc, "//@config_version", &v1_str))) {
+  if ((error = ccs_get(desc, "/cluster/@config_version", &v1_str))) {
     fprintf(stderr, "Unable to get current config_version: %s\n", strerror(-error));
     ccs_disconnect(desc);
     return error;
@@ -355,7 +355,7 @@ int update(char *location)
     return 0;
   }
 
-  if ((error = ccs_get(desc, "//@config_version", &v3_str))) {
+  if ((error = ccs_get(desc, "/cluster/@config_version", &v3_str))) {
     ccs_disconnect(desc);
     return 0;
   }
diff --git a/ccs/daemon/misc.c b/ccs/daemon/misc.c
index 6907268..07fda2c 100644
--- a/ccs/daemon/misc.c
+++ b/ccs/daemon/misc.c
@@ -57,7 +57,7 @@ int get_doc_version(xmlDocPtr ldoc){
     goto fail;
   }
 
-  obj = xmlXPathEvalExpression((xmlChar *)"//cluster/@config_version", ctx);
+  obj = xmlXPathEvalExpression((xmlChar *)"/cluster/@config_version", ctx);
   if(!obj || !obj->nodesetval || (obj->nodesetval->nodeNr != 1)){
     log_err("Error while retrieving config_version.\n");
     error = -ENODATA;
@@ -123,7 +123,7 @@ char *get_cluster_name(xmlDocPtr ldoc){
     goto fail;
   }
 
-  obj = xmlXPathEvalExpression((xmlChar *)"//cluster/@name", ctx);
+  obj = xmlXPathEvalExpression((xmlChar *)"/cluster/@name", ctx);
   if(!obj || !obj->nodesetval || (obj->nodesetval->nodeNr != 1)){
     log_err("Error while retrieving config_version.\n");
     error = -ENODATA;
@@ -156,6 +156,3 @@ fail:
   EXIT("get_cluster_name");
   return rtn;
 }
-
-
-
diff --git a/gnbd/tools/fence_gnbd/Makefile b/fence/agents/gnbd/Makefile
similarity index 94%
rename from gnbd/tools/fence_gnbd/Makefile
rename to fence/agents/gnbd/Makefile
index 2976bbc..1b8a798 100644
--- a/gnbd/tools/fence_gnbd/Makefile
+++ b/fence/agents/gnbd/Makefile
@@ -25,10 +25,9 @@ include $(OBJDIR)/make/uninstall.mk
 
 OBJS= main.o
 
-CFLAGS += -I$(S)/../../include -I$(S)/../gnbd_import
+CFLAGS += -I$(SRCDIR)/gnbd/tools/gnbd_import
 CFLAGS += -I${incdir}
 
-
 ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
 
diff --git a/gnbd/tools/fence_gnbd/main.c b/fence/agents/gnbd/main.c
similarity index 100%
rename from gnbd/tools/fence_gnbd/main.c
rename to fence/agents/gnbd/main.c
diff --git a/fence/agents/apc/Makefile b/fence/agents/ifmib/Makefile
similarity index 97%
copy from fence/agents/apc/Makefile
copy to fence/agents/ifmib/Makefile
index 0299a61..cf9e6de 100644
--- a/fence/agents/apc/Makefile
+++ b/fence/agents/ifmib/Makefile
@@ -13,6 +13,6 @@
 
 include ../../../make/defines.mk
 
-TARGET= fence_apc
+TARGET= fence_ifmib
 
 include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/ifmib/README b/fence/agents/ifmib/README
new file mode 100644
index 0000000..b6e7123
--- /dev/null
+++ b/fence/agents/ifmib/README
@@ -0,0 +1,45 @@
+Intro:
+------
+This is an SNMP-based fencing agent for RHCS.  It was designed with the use-case
+of disabling ethernet ports on an iSCSI SAN, but could be used to disable any
+port on any SNMP v2c device that implementes the IF-MIB.
+
+The script requires PySNMP version 2 to be installed and working on all nodes
+in the cluster.  There are no requirements for any MIBs to be setup --- all of
+the required OIDs are hard-coded into the script.  Since the IF-MIB is an IETF
+standard, these identifiers are very widely supported and will not change.
+
+
+Typical usage:
+--------------
+To use this agen with the switch used on the iSCSI network, you'll require:
+   1) A managed switch running SNMP.
+   2) An SNMP community with write privileges.
+   3) Permission to send SNMP through any ACLs or firewalls from the nodes.
+   4) The ifIndex associated with the ports being used by the cluster nodes.
+
+Consider a three-node cluster composed of A, B, and C.  Each node has two
+network interfaces - one used for network and cluster communication, the second
+used for iSCSI traffic.  If A needs to be fenced, B and C will run this script
+to administratively disable the switchport for A's connection to the iSCSI
+storage.
+
+If you are using a single interface for cluster and iSCSI traffic, this will
+still work, but you will lose network connectivity to the fenced host.
+
+
+cluster.conf:
+-------------
+There is no GUI support for this fence agent at this time.  To use it, you will
+need something like this cluster.conf
+
+<fencedevice agent="fence_ifmib" name="myswitch" comm="fencing" ipaddr="sw1"/>
+
+In a node's fencing methods, you'll include a line like this:
+
+<device name="myswitch" ifindex="43" option="off"/>
+
+This node will be fenced by disabling the port with ifIndex 43 on the host sw1.
+In SNMP speak, we set IF-MIB::ifAdminStatus.43 = down(2).
+
+
diff --git a/fence/agents/ifmib/fence_ifmib.py b/fence/agents/ifmib/fence_ifmib.py
new file mode 100644
index 0000000..48f1187
--- /dev/null
+++ b/fence/agents/ifmib/fence_ifmib.py
@@ -0,0 +1,221 @@
+#!/usr/bin/python
+# fence_ifmib.py: fabric fencing for RHCS based on setting a network interface
+# to admin down.  Intended to be used for iSCSI connections, can be used with
+# anything that supports the IF-MIB and SNMP v2c.
+#
+# Written by Ross Vandegrift <ross kallisti us>
+# Copyright (C) 2008 Ross Vandegrift
+#  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.
+
+# this is a ugly hack to make the build system happy. The original
+# author and copyright are the one on the file header right above.
+#BEGIN_VERSION_GENERATION
+RELEASE_VERSION="New fence_ifmib"
+REDHAT_COPYRIGHT=""
+BUILD_DATE="March, 2008"
+#END_VERSION_GENERATION
+
+import os
+os.environ['PYSNMP_API_VERSION'] = 'v2'
+import sys, getopt, random, socket
+from pysnmp import role, v2c, asn1
+
+ifAdminStatus = '.1.3.6.1.2.1.2.2.1.7.'
+up = 1
+down = 2
+testing = 3
+
+def usage():
+    line = '\t%s\t%s'
+    print ''
+    print 'This script fences a node by sending a command via SNMP to set'
+    print 'ifAdminStatus to down.  It is designed to kill node access'
+    print 'to the shared storage.  It only supports SNMP v2c.'
+    print ''
+    print 'Usage: fence_ifmib [options]'
+    print line % ('-h', '\tPrint usage')
+    print line % ('-V', '\tRun verbosely')
+    print line % ('-c [private]', 'Write community string to use')
+    print line % ('-a [hostname]', 'IP/hostname of SNMP agent')
+    print line % ('-i [index]', 'ifIndex entry of the port ')
+    print line % ('-o [action]', 'One of down, up, or status')
+
+
+def vprint(v, s):
+    if v:
+        print s
+
+
+def parseargs():
+    try:
+        opt, arg = getopt.getopt (sys.argv[1:], 'hVc:v:a:i:o:')
+    except getopt.GetoptError, e:
+        print str (e)
+        usage ()
+        sys.exit (-1)
+
+    comm = ipaddr = ifindex = option = verbose = None
+
+    for o, a in opt:
+        if o == '-h':
+            usage ()
+            sys.exit (-1)
+        if o == '-V':
+            verbose = True
+        if o == '-c':
+            comm = a
+        if o == '-a':
+            ipaddr = a
+        if o == '-i':
+            try:
+                ifindex = int(a)
+            except:
+                sys.stderr.write ('fence_ifmib: ifIndex must be an integer\n')
+                usage ()
+                sys.exit (-1)
+        if o == '-o':
+            option = a
+            if option not in ('on', 'off', 'status'):
+                sys.stderr.write ('fence_ifmib: option must be one of on, off, or status\n')
+                usage ()
+                sys.exit (-1)
+
+    if comm == None or ipaddr == None or ifindex == None \
+            or option == None:
+        sts.stderr.write ('All args are madatory!\n')
+        usage ()
+        sys.exit (-1)
+
+    return (comm, ipaddr, ifindex, option, verbose)
+
+
+def parsestdin():
+    params = {}
+    for line in sys.stdin:
+        val = line.split('=')
+        if len (val) == 2:
+            params[val[0].strip ()] = val[1].strip ()
+
+    try:
+        comm = params['comm']
+    except:
+        sys.stdout.write ('fence_ifmib: Error reading community string\n')
+        sys.exit (1)
+
+    try:
+        ipaddr = params['ipaddr']
+    except:
+        sys.stdout.write ('fence_ifmib: Error reading destination IP/host\n')
+        sys.exit (1)
+
+    try:
+        ifindex = params['ifindex']
+    except:
+        sys.stdout.write ('fence_ifmib: Error reading ifindex\n')
+        sys.exit (1)
+
+    try:
+        option = params['option']
+    except:
+        option = 'off'
+
+    return (comm, ipaddr, ifindex, option)
+            
+
+def snmpget (host, comm, oid):
+    req = v2c.GETREQUEST ()
+    encoded_oids = map (asn1.OBJECTID().encode, [oid,])
+    req['community'] = comm
+    tr = role.manager ((host, 161))
+    rsp = v2c.RESPONSE ()
+    (rawrsp, src) = tr.send_and_receive (req.encode (encoded_oids=encoded_oids))
+    rsp.decode (rawrsp)
+    if rsp['error_status']:
+        raise IOError('SNMP error while reading')
+    oids = map (lambda x: x[0], map(asn1.OBJECTID ().decode, rsp['encoded_oids']))
+    vals = map (lambda x: x[0] (), map(asn1.decode, rsp['encoded_vals']))
+    return vals[0]
+
+
+def snmpset (host, comm, oid, type, value):
+    req = v2c.SETREQUEST (request_id=random.randint (1,2**16-1))
+    req['community'] = comm
+    tr = role.manager ((host, 161))
+    rsp = v2c.RESPONSE ()
+    encoded_oids = map (asn1.OBJECTID ().encode, [oid,])
+    encoded_vals = []
+    encoded_vals.append (eval ('asn1.' + type + '()').encode (value))
+    (rawrsp, src) = tr.send_and_receive (req.encode (encoded_oids=encoded_oids, encoded_vals=encoded_vals))
+    rsp.decode(rawrsp)
+    if rsp['error_status']:
+        raise IOError('SNMP error while setting')
+    oids = map (lambda x: x[0], map (asn1.OBJECTID().decode, rsp['encoded_oids']))
+    vals = map (lambda x: x[0] (), map (asn1.decode, rsp['encoded_vals']))
+    if vals[0] == value:
+        return vals[0]
+    else:
+        raise IOError('SNMP error while setting')
+
+
+def main():
+    if len (sys.argv) > 1:
+        (comm, host, index, option, verbose) = parseargs ()
+    else:
+        verbose = False
+        (comm, host, index, option) = parsestdin ()
+
+    try:
+        switch = socket.gethostbyname (host)
+    except socket.gaierror, err:
+        vprint (verbose, 'fence_ifmib: %s' % str (err[1]))
+        sys.exit(1)
+
+    if option == 'on':
+        value = up
+    elif option == 'off':
+        value = down
+    elif option == 'status':
+        value = None
+
+    if value:
+        # For option in (on, off) - write and verify
+        try:
+            r = snmpset (switch, comm, ifAdminStatus + str (index), 'INTEGER', value)
+        except:
+            sys.stderr.write ('fence_ifmib: Error during snmp write\n')
+            sys.exit (1)
+        
+        try:
+            s = int (snmpget (switch, comm, ifAdminStatus + str (index)))
+        except:
+            sys.stderr.write ('fence_ifmib: Error during fence verification\n')
+            sys.exit (1)
+
+        if s == value:
+            vprint (verbose, 'fence_ifmib: action %s sucessful' % option)
+            sys.exit (0)
+        else:
+            vprint (verbose, 'fence_ifmib: action %s failed' % option)
+            sys.exit (1)
+    else: # status
+        try: 
+            r = int (snmpget (switch, comm, ifAdminStatus + str (index)))
+        except:
+            sys.stderr.write ('fence_ifmib: Error during snmp read\n')
+            sys.exit (1)
+
+        if r == up:
+            vprint (verbose, 'fence_ifmib: Port is admin up')
+            sys.exit (0)
+        elif r == down:
+            vprint (verbose, 'fence_ifmib: Port is admin down')
+            sys.exit (2)
+        elif r == testing:
+            vprint (verbose, 'fence_ifmib: Port is admin testing')
+            sys.exit (2)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 6d2cf2c..44abaef 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -10,9 +10,9 @@ import telnetlib
 
 ## do not add code here.
 #BEGIN_VERSION_GENERATION
-RELEASE_VERSION="New fence lib agent - test release on steroids"
-REDHAT_COPYRIGHT=""
-BUILD_DATE="March, 2008"
+RELEASE_VERSION = "New fence lib agent - test release on steroids"
+REDHAT_COPYRIGHT = ""
+BUILD_DATE = "March, 2008"
 #END_VERSION_GENERATION
 
 POWER_TIMEOUT = 20
@@ -29,6 +29,9 @@ EC_TIMED_OUT       = 5
 EC_WAITING_ON      = 6
 EC_WAITING_OFF     = 7
 
+TELNET_PATH = "/usr/bin/telnet"
+SSH_PATH    = "/usr/bin/ssh"
+
 all_opt = {
 	"help"    : {
 		"getopt" : "h",
@@ -124,10 +127,10 @@ class fspawn(pexpect.spawn):
 			options["debug_fh"].write(self.before + self.after)
 		return result
 
-def version(command, release, build_date, copyright):
-	print command, " ", release, " ", build_date;
-	if len(copyright) > 0:
-		print copyright
+def version(command, release, build_date, copyright_notice):
+	print command, " ", release, " ", build_date
+	if len(copyright_notice) > 0:
+		print copyright_notice
 
 def fail_usage(message = ""):
 	if len(message) > 0:
@@ -166,7 +169,8 @@ def process_input(avail_opt):
 	##
 	## Set standard environment
 	#####
-	os.unsetenv("LANG")
+	os.putenv("LANG", "C")
+	os.putenv("LC_ALL", "C")
 
 	##
 	## Prepare list of options for getopt
@@ -176,7 +180,7 @@ def process_input(avail_opt):
 		if all_opt.has_key(k):
 			getopt_string += all_opt[k]["getopt"]
 		else:
-			fail_usage("Parse error: unknown option '"+k+"'");
+			fail_usage("Parse error: unknown option '"+k+"'")
 
 	##
 	## Read options from command line or standard input
@@ -201,7 +205,8 @@ def process_input(avail_opt):
 		name = ""
 		for line in sys.stdin.readlines():
 			line = line.strip()
-			if ((line.startswith("#")) or (len(line) == 0)): pass
+			if ((line.startswith("#")) or (len(line) == 0)):
+				continue
 
 			(name, value) = (line + "=").split("=", 1)
 			value = value[:-1]
@@ -294,7 +299,7 @@ def check_input(device_opt, opt):
 	return options
 	
 def wait_power_status(tn, options, get_power_fn):
-	for x in range(POWER_TIMEOUT):
+	for dummy in xrange(POWER_TIMEOUT):
 		if get_power_fn(tn, options) != options["-o"]:
 			time.sleep(1)
 		else:
@@ -331,7 +336,7 @@ def fence_action(tn, options, set_power_fn, get_power_fn):
 		options["-o"] = "on"
 		set_power_fn(tn, options)
 		if wait_power_status(tn, options, get_power_fn) == 0:
-			fail(EC_WAITING_ON)
+			sys.stderr.write('Timed out waiting to power ON\n')
 		print "Success: Rebooted"
 	elif options["-o"] == "status":
 		print "Status: " + status.upper()
@@ -342,10 +347,10 @@ def fence_login(options):
 		re_pass  = re.compile("password", re.IGNORECASE)
 
 		if options.has_key("-x") and 0 == options.has_key("-k"):
-			command = 'ssh ' + options["-l"] + "@" + options["-a"]
+			command = '%s %s %s' % (SSH_PATH, options["-l"], options["-a"])
 			if options.has_key("ssh_options"):
 				command += ' ' + options["ssh_options"]
-			conn = fspawn (command)
+			conn = fspawn(command)
 			result = conn.log_expect(options, [ "ssword:", "Are you sure you want to continue connecting (yes/no)?" ], LOGIN_TIMEOUT)
 			if result == 1:
 				conn.sendline("yes")
@@ -353,7 +358,7 @@ def fence_login(options):
 			conn.sendline(options["-p"])
 			conn.log_expect(options, options["-c"], LOGIN_TIMEOUT)
 		elif options.has_key("-x") and 1 == options.has_key("-k"):
-			conn = fspawn ('ssh ' + options["-l"] + "@" + options["-a"] + " -i " + options["-k"])
+			conn = fspawn('%s %s %s -i %s' % (SSH_PATH, options["-l"], options["-a"], options["-k"]))
 			result = conn.log_expect(options, [ options["-c"], "Are you sure you want to continue connecting (yes/no)?", "Enter passphrase for key '"+options["-k"]+"':" ], LOGIN_TIMEOUT)
 			if result == 1:
 				conn.sendline("yes")
@@ -365,7 +370,7 @@ def fence_login(options):
 				else:
 					fail_usage("Failed: You have to enter passphrase (-p) for identity file")
 		else:
-			conn = fspawn ('telnet ' + options["-a"])
+			conn = fspawn('%s %s' % (TELNET_PATH, options["-a"]))
 			conn.log_expect(options, re_login, LOGIN_TIMEOUT)
 			conn.send(options["-l"]+"\r\n")
 			conn.log_expect(options, re_pass, SHELL_TIMEOUT)
diff --git a/fence/man/Makefile b/fence/man/Makefile
index 147c7ec..2c18dba 100644
--- a/fence/man/Makefile
+++ b/fence/man/Makefile
@@ -19,6 +19,8 @@ TARGET= fence.8 \
 	fence_brocade.8 \
 	fence_drac.8 \
 	fence_egenera.8 \
+	fence_gnbd.8 \
+	fence_ifmib.8 \
 	fence_ilo.8 \
 	fence_manual.8 \
 	fence_mcdata.8 \
diff --git a/gnbd/man/fence_gnbd.8 b/fence/man/fence_gnbd.8
similarity index 100%
rename from gnbd/man/fence_gnbd.8
rename to fence/man/fence_gnbd.8
diff --git a/fence/man/fence_ifmib.8 b/fence/man/fence_ifmib.8
new file mode 100644
index 0000000..237fcbc
--- /dev/null
+++ b/fence/man/fence_ifmib.8
@@ -0,0 +1,69 @@
+.\"  Copyright (C) 2008 Ross Vandegrift.  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.
+
+.TH fence_ifmib 8
+
+.SH NAME
+fence_ifmib - I/O Fencing agent for IF-MIB capable SNMP devices
+
+.SH SYNOPSIS
+.B 
+fence_ifmib
+[\fIOPTION\fR]...
+
+.SH DESCRIPTION
+fence_ifmib is an I/O Fencing agent which can be used with any IF-MIB capable
+SNMP device.  It was written with managed ethernet switches in mind, in order
+to fence iSCSI SAN connections.  However, there are many devices that support
+the IF-MIB interface.  The agent uses IF-MIB::ifAdminStatus to control the
+state of an interface.
+
+fence_ifmib accepts options on the command line as well as from stdin.  
+Fenced sends parameters through stdin when it execs the agent.  fence_ifmib 
+can be run by itself with command line options.  This is useful for testing.
+
+.SH OPTIONS
+.TP
+\fB-a\fP \fIIPaddress\fR
+IP address or hostname of the SNMP agent to be written.
+.TP
+\fB-h\fP 
+Print out a help message describing available options, then exit.
+.TP
+\fB-c\fP \fIcommunity\fR
+The write community string to be used in the request.
+.TP
+\fB-i\fP \fIiIindex\fR
+The ifIndex of the interface to be acted upon.  This will need to be determined
+manually prior to configuration.
+.TP
+\fB-o\fP \fIaction\fR
+The action required.  off (default), on, or status.  off sets ifAdminStatus
+down, on sets ifAdminStatus up, and status returns the current state.
+.TP
+\fB-V\fP
+Verbose.  Print informational messages to standard out.
+
+.SH STDIN PARAMETERS
+.TP
+\fIagent = < param >\fR
+This option is used by fence_node(8) and is ignored by fence_ifmib.
+.TP
+\fIipaddr = < hostname | ip >\fR
+IP address or hostname of the device.
+.TP
+\fIcomm = < param >\fR
+Write community string to be used in the request.
+.TP
+\fIifindex = < param >\fR
+The ifIndex of the interface to be acted upon.
+.TP
+\fIoption = < param >\fR
+The action required.  off (default), on, or status.
+.TP
+
+.SH SEE ALSO
+fence(8), fence_node(8)
diff --git a/gfs2/mkfs/Makefile b/gfs2/mkfs/Makefile
index ffd97e5..35c521a 100644
--- a/gfs2/mkfs/Makefile
+++ b/gfs2/mkfs/Makefile
@@ -26,6 +26,7 @@ OBJS=	main.o \
 
 CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_GNU_SOURCE
 CFLAGS += -I${KERNEL_SRC}/include/
+CFLAGS += -I${volidincdir}
 CFLAGS += -I$(S)/../include -I$(S)/../libgfs2
 CFLAGS += -I${incdir}
 
diff --git a/gnbd/man/Makefile b/gnbd/man/Makefile
index 64119d4..c6e60ad 100644
--- a/gnbd/man/Makefile
+++ b/gnbd/man/Makefile
@@ -14,8 +14,7 @@
 TARGET= gnbd.8 \
 	gnbd_export.8 \
 	gnbd_import.8 \
-	gnbd_serv.8 \
-	fence_gnbd.8
+	gnbd_serv.8
 
 include ../../make/defines.mk
 include $(OBJDIR)/make/man.mk
diff --git a/gnbd/tools/Makefile b/gnbd/tools/Makefile
index e5c9a4e..5a4f708 100644
--- a/gnbd/tools/Makefile
+++ b/gnbd/tools/Makefile
@@ -14,4 +14,4 @@
 include ../../make/defines.mk
 include $(OBJDIR)/make/passthrough.mk
 
-SUBDIRS=fence_gnbd gnbd_export gnbd_import
+SUBDIRS=gnbd_export gnbd_import
diff --git a/rgmanager/include/reslist.h b/rgmanager/include/reslist.h
index 4efe879..219386b 100644
--- a/rgmanager/include/reslist.h
+++ b/rgmanager/include/reslist.h
@@ -57,7 +57,7 @@
 #endif
 
 #define RESOURCE_ROOTDIR	SHAREDIR
-#define RESOURCE_TREE_ROOT	"//rm"
+#define RESOURCE_TREE_ROOT	"/cluster/rm"
 #define RESOURCE_BASE		RESOURCE_TREE_ROOT "/resources"
 #define RESOURCE_ROOT_FMT 	RESOURCE_TREE_ROOT "/%s[%d]"
 


hooks/post-receive
--
Cluster Project


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]