fence-agents: master - fence_rsb: Fence agent ported to fencing library
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=com...
Commit: 6f27315c0737a98395b7d905dc289ef3c344630b
Parent: 664ccc6aa2fcd4b79459ca3083f8528969300a78
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Nov 25 11:41:05 2011 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Dec 9 09:44:24 2011 +0100
fence_rsb: Fence agent ported to fencing library
Fence agent was rewritten to use fencing library. Main benefits are
support for ssh connection, XML metadata, automatic man page generation.
Resolves: rhbz#742003
---
fence/agents/lib/fencing.py.py | 2 +-
fence/agents/rsb/Makefile.am | 5 +-
fence/agents/rsb/fence_rsb.8 | 76 ------
fence/agents/rsb/fence_rsb.py | 491 ++++++++--------------------------------
4 files changed, 102 insertions(+), 472 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index ec84bbc..8be0a61 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -871,7 +871,7 @@ def fence_login(options):
try:
re_login = re.compile("(login\s*: )|(Login Name: )|(username: )|(User Name :)", re.IGNORECASE)
- re_pass = re.compile("password", re.IGNORECASE)
+ re_pass = re.compile("(password)|(pass phrase)", re.IGNORECASE)
if options.has_key("-z"):
command = '%s %s %s %s' % (SSL_PATH, force_ipvx, options["-a"], options["-u"])
diff --git a/fence/agents/rsb/Makefile.am b/fence/agents/rsb/Makefile.am
index e8193be..939db98 100644
--- a/fence/agents/rsb/Makefile.am
+++ b/fence/agents/rsb/Makefile.am
@@ -8,9 +8,10 @@ EXTRA_DIST = $(SRC)
sbin_SCRIPTS = $(TARGET)
-dist_man_MANS = $(TARGET).8
+man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fenceman.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/rsb/fence_rsb.8 b/fence/agents/rsb/fence_rsb.8
deleted file mode 100644
index d278271..0000000
--- a/fence/agents/rsb/fence_rsb.8
+++ /dev/null
@@ -1,76 +0,0 @@
-.TH fence_rsb 8
-
-.SH NAME
-fence_rsb - I/O Fencing agent for Fujitsu-Siemens RSB
-
-.SH SYNOPSIS
-.B
-fence_rsb
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_rsb is an I/O Fencing agent which can be used with the Fujitsu-Siemens
-RSB management interface. It logs into an RSB device via telnet and reboots
-the associated machine. Lengthy telnet connections to the RSB device
-should be avoided while a GFS cluster is running because the connection
-will block any necessary fencing actions.
-
-fence_rsb accepts options on the command line as well as from stdin.
-Fenced sends parameters through stdin when it execs the agent. fence_rsb
-can be run by itself with command line options. This is useful for testing.
-
-Vendor URL: http://www.fujitsu.com
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fR
-IP address or hostname of the RSB device.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fR
-Login name.
-.TP
-\fB-n\fP \fItelnet_port\fR
-The port number on which the telnet service listens.
-.TP
-\fB-o\fP \fIaction\fR
-The action required. This can be reboot (default), off, on, or status.
-.TP
-\fB-p\fP \fIpassword\fR
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-v\fP
-Verbose. Print informational messages to standard out.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_rsb.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the device.
-.TP
-\fItelnet_port = < port number >\fR
-The port number on which the telnet service listens.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIoption = < param >\fR
-The action required. This can be reboot (default), off, on, or status.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/rsb/fence_rsb.py b/fence/agents/rsb/fence_rsb.py
old mode 100644
new mode 100755
index 759ae2d..fe1ec60
--- a/fence/agents/rsb/fence_rsb.py
+++ b/fence/agents/rsb/fence_rsb.py
@@ -1,18 +1,8 @@
#!/usr/bin/python
-import getopt, sys
-import os
-import socket
-import time
-import atexit
-
-from telnetlib import Telnet
-
-TELNET_TIMEOUT=30 #How long to wait for a response from a telnet try
-MAX_TRIES = 20
-
-# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and
-# "#END_VERSION_GENERATION" It is generated by the Makefile
+import sys, re, pexpect, exceptions
+sys.path.append("@FENCEAGENTSLIBDIR@")
+from fencing import *
#BEGIN_VERSION_GENERATION
RELEASE_VERSION=""
@@ -20,389 +10,104 @@ REDHAT_COPYRIGHT=""
BUILD_DATE=""
#END_VERSION_GENERATION
-def usage():
- print "Usage:"
- print "fence_rsb [options]"
- print "Options:"
- print " -a <ipaddress> ip or hostname of rsb"
- print " -h print out help"
- print " -l [login] login name"
- print " -n [telnet port] telnet port"
- print " -p [password] password"
- print " -S [path] script to run to retrieve password"
- print " -o [action] reboot (default), off, on, or status"
- print " -v Verbose Verbose mode"
- print " -V Print Version, then exit"
-
- sys.exit (0)
-
-def version():
- print "fence_rsb %s %s\n" % (RELEASE_VERSION, BUILD_DATE)
- print "%s\n" % REDHAT_COPYRIGHT
- sys.exit(0)
+def get_power_status(conn, options):
+ try:
+ conn.send("2")
+ conn.log_expect(options, options["-c"], int(options["-Y"]))
+ status = re.compile("Power Status : (on|off)", re.IGNORECASE).search(conn.before).group(1)
+ conn.send("0")
+ conn.log_expect(options, options["-c"], int(options["-Y"]))
+
+ return (status.lower().strip())
+ except pexpect.EOF:
+ fail(EC_CONNECTION_LOST)
+ except pexpect.TIMEOUT:
+ fail(EC_TIMED_OUT)
+
+def set_power_status(conn, options):
+ action = {
+ 'on' : "4",
+ 'off': "1"
+ }[options["-o"]]
-def atexit_handler():
try:
- sys.stdout.close()
- os.close(1)
- except IOError:
- sys.stderr.write("%s failed to close standard output\n"%(sys.argv[0]))
- sys.exit(1)
+ conn.send("2")
+ conn.log_expect(options, options["-c"], int(options["-Y"]))
+ conn.sendline(action)
+ conn.log_expect(options, ["want to power off", "'yes' or 'no'"], int(options["-Y"]))
+ conn.send("yes\r")
+ conn.log_expect(options, "any key to continue", int(options["-g"]))
+ conn.send("\r")
+ conn.log_expect(options, options["-c"], int(options["-Y"]))
+ conn.sendline("0")
+ conn.log_expect(options, options["-c"], int(options["-Y"]))
+ except pexpect.EOF:
+ fail(EC_CONNECTION_LOST)
+ except pexpect.TIMEOUT:
+ fail(EC_TIMED_OUT)
def main():
- depth = 0
- POWER_OFF = 0
- POWER_ON = 1
- POWER_STATUS = 2
- POWER_REBOOT = 3
-
- STATUS_ON = 0
- STATUS_OFF = 2
-
- power_command_issued = 0
-
- address = ""
- login = ""
- passwd = ""
- passwd_script = ""
- action = POWER_REBOOT #default action
- telnet_port = 3172
- verbose = False
- power_state = None
-
- standard_err = 2
-
- result = 0
-
- completed_action = 0
-
- #set up regex list
- USERNAME = 0
- PASSWORD = 1
- PROMPT = 2
- STATE = 3
- ERROR = 4
- CONT = 5
- CONFIRM = 6
- DONE = 7
-
- regex_list = list()
- regex_list.append("user name\s*:")
- regex_list.append("pass phrase\s*:")
- regex_list.append("[Ee]nter\s+[Ss]election[^\r\n]*:")
- regex_list.append("[pP]ower Status\s*:")
- regex_list.append("[Ee]rror\s*:")
- regex_list.append("[Pp]ress any key to continue")
- regex_list.append("really want to")
- regex_list.append("CLOSING TELNET CONNECTION")
-
- atexit.register(atexit_handler)
-
- if len(sys.argv) > 1:
- try:
- opts, args = getopt.getopt(sys.argv[1:], "a:hl:n:o:p:S:vV", ["help", "output="])
- except getopt.GetoptError:
- #print help info and quit
- usage()
- sys.exit(2)
-
- for o, a in opts:
- if o == "-v":
- verbose = True
- if o == "-V":
- version()
- if o in ("-h", "--help"):
- usage()
- sys.exit(0)
- if o == "-l":
- login = a
- if o == "-n":
- telnet_port = a
- if o == "-p":
- passwd = a
- if o == "-S":
- passwd_script = a
- if o == "-o":
- a_lower=a.lower()
- if a_lower == "off":
- action = POWER_OFF
- elif a_lower == "on":
- action = POWER_ON
- elif a_lower == "status":
- action = POWER_STATUS
- elif a_lower == "reboot":
- action = POWER_REBOOT
- else:
- usage()
- sys.exit(1)
- if o == "-a":
- address = a
- if address == "" or login == "" or (passwd == "" and passwd_script == ""):
- usage()
- sys.exit(1)
-
- else: #Take args from stdin...
- params = {}
- #place params in dict
- for line in sys.stdin:
- val = line.split("=")
- if len(val) == 2:
- params[val[0].strip()] = val[1].strip()
-
- try:
- address = params["ipaddr"]
- except KeyError, e:
- os.write(standard_err, "FENCE: Missing ipaddr param for fence_rsb...exiting")
- sys.exit(1)
-
- try:
- login = params["login"]
- except KeyError, e:
- os.write(standard_err, "FENCE: Missing login param for fence_rsb...exiting")
- sys.exit(1)
-
- try:
- if 'passwd' in params:
- passwd = params["passwd"]
- if 'passwd_script' in params:
- passwd_script = params['passwd_script']
- if passwd == "" and passwd_script == "":
- raise Exception, "missing password"
- except KeyError, e:
- os.write(standard_err, "FENCE: Missing passwd param for fence_rsb...exiting")
- sys.exit(1)
-
- try:
- telnet_port = params["telnet_port"]
- except KeyError, e:
- pass
-
- try:
- a = params["option"]
- a_lower=a.lower()
- if a_lower == "off":
- action = POWER_OFF
- elif a_lower == "on":
- action = POWER_ON
- elif a_lower == "reboot":
- action = POWER_REBOOT
- except KeyError, e:
- action = POWER_REBOOT
-
- ####End of stdin section
-
-
- # retrieve passwd from passwd_script (if specified)
- passwd_scr = ''
- if len(passwd_script):
- try:
- if not os.access(passwd_script, os.X_OK):
- raise Exception, 'script not executable'
- p = os.popen(passwd_script, 'r', 1024)
- passwd_scr = p.readline().strip()
- if p.close() != None:
- raise Exception, 'script failed'
- except:
- sys.stderr.write('password-script "%s" failed\n' % passwd_script)
- passwd_scr = ''
-
- if passwd == "" and passwd_scr == "":
- sys.stderr.write('password not available, exiting...')
- sys.exit(1)
- elif passwd == passwd_scr:
- pass
- elif passwd and passwd_scr:
- # execute self, with password_scr as passwd,
- # if that fails, continue with "passwd" argument as password
- if len(sys.argv) > 1:
- comm = sys.argv[0]
- skip_next = False
- for w in sys.argv[1:]:
- if skip_next:
- skip_next = False
- elif w in ['-p', '-S']:
- skip_next = True
- else:
- comm += ' ' + w
- comm += ' -p ' + passwd_scr
- ret = os.system(comm)
- if ret != -1 and os.WIFEXITED(ret) and os.WEXITSTATUS(ret) == 0:
- # success
- sys.exit(0)
- else:
- sys.stderr.write('Use of password from "passwd_script" failed, trying "passwd" argument\n')
- else: # use stdin
- p = os.popen(sys.argv[0], 'w', 1024)
- for par in params:
- if par not in ['passwd', 'passwd_script']:
- p.write(par + '=' + params[par] + '\n')
- p.write('passwd=' + passwd_scr + '\n')
- p.flush()
- if p.close() == None:
- # success
- sys.exit(0)
- else:
- sys.stderr.write('Use of password from "passwd_script" failed, trying "passwd" argument\n')
- elif passwd_scr:
- passwd = passwd_scr
- # passwd all set
-
-
-
- try:
- telnet_port = int(telnet_port)
- except:
- os.write(standard_err, ("FENCE: Invalid telnet port: %s\n" % telnet_port))
- sys.exit(1)
-
- ##Time to open telnet session and log in.
- try:
- sock = Telnet(address.strip(), telnet_port)
- except socket.error, (errno, msg):
- my_msg = "FENCE: A problem was encountered opening a telnet session with " + address
- os.write(standard_err, my_msg)
- os.write(standard_err, ("FENCE: Error number: %d -- Message: %s\n" % (errno, msg)))
- os.write(standard_err, "Firewall issue? Correct address?\n")
- sys.exit(1)
-
- if verbose:
- #sock.set_debuglevel(10000)
- print "socket open to %s %d\n" % (address, telnet_port)
-
- tries = MAX_TRIES
- while 1:
- i, mo, txt = sock.expect(regex_list, TELNET_TIMEOUT)
- if i == ERROR:
- os.write(standard_err,("FENCE: An error was encountered when communicating with the rsb device at %s" % address))
- buf = sock.read_eager()
- os.write(standard_err,("FENCE: The error message is - %s" % txt + " " + buf))
- sock.close()
- sys.exit(1)
-
- try:
- buf = sock.read_eager()
- except EOFError:
- if completed_action == 1:
- # action was completed succesfully, connection closed is OK
- sys.exit(result)
- else:
- raise
-
- if i == USERNAME:
- if verbose:
- print "Sending login: %s\n" % login
- sock.write(login + "\r")
-
- elif i == PASSWORD:
- if verbose:
- print "Sending password: %s\n" % passwd
- sock.write(passwd + "\r")
-
- elif i == CONT:
- if verbose:
- print "Sending continue char..."
- sock.write("\r")
- time.sleep(2)
-
- elif i == CONFIRM:
- if verbose:
- print "Confirming..."
- sock.write("yes\r")
-
- elif i == PROMPT:
- if verbose:
- print "Evaluating prompt...\n"
-
- if depth == 0:
- sock.write("2\r")
- depth += 1
- elif depth == 1:
- if action == POWER_OFF or action == POWER_REBOOT:
- if power_command_issued == 0:
- if verbose:
- print "Sending power off %s" % address
- sock.write("1\r")
- power_command_issued += 1
- time.sleep(2)
- elif power_command_issued and power_state == 0:
- if verbose:
- print "Power off was successful"
- if action == POWER_OFF:
- completed_action = 1
- depth += 1
- sock.write("0\r")
- else:
- action = POWER_ON
- power_command_issued = 0
- sock.write("\r")
- elif tries > 0:
- if verbose:
- print "Waiting for power off to complete"
- tries -= 1
- sock.write("\r")
- time.sleep(2)
- else:
- os.write(standard_err, "FENCE: Unable to power off server")
- depth += 1
- sock.write("0\r")
-
- elif action == POWER_ON:
- if power_command_issued == 0:
- if verbose:
- print "Sending power on %s" % address
- sock.write("4\r")
- power_command_issued += 1
- time.sleep(2)
- elif power_command_issued and power_state == 1:
- if verbose:
- print "Power on was successful"
- completed_action = 1
- depth += 1
- sock.write("0\r")
- elif tries > 0:
- if verbose:
- print "Waiting for power on to complete"
- tries -= 1
- sock.write("\r")
- time.sleep(2)
- else:
- os.write(standard_err, "FENCE: Unable to power on server")
- depth += 1
- sock.write("0\r")
- else:
- sock.write("0\r")
-
- elif i == STATE:
- if buf.find(" On") != (-1):
- power_state = 1
- elif buf.find(" Off") != (-1):
- power_state = 0
- else:
- power_state = None
-
- if action == POWER_STATUS:
- if verbose:
- print "Determining power state..."
- if power_state == 1:
- print "Server is On"
- result = STATUS_ON
- elif power_state == 0:
- print "Server is Off"
- result = STATUS_OFF
- else:
- os.write(standard_err, ("FENCE: Cannot determine power state: %s" % buf))
- sys.exit(1)
- depth = 2
- completed_action = 1
-
- elif i == DONE:
- break
-
- else:
- sock.write("\r")
-
- sock.close()
- sys.exit(result)
+ device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug",
+ "action", "ipaddr", "login", "passwd", "passwd_script",
+ "secure", "identity_file", "separator", "cmd_prompt",
+ "inet4_only", "inet6_only", "ipport", "telnet_port",
+ "power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
+
+ atexit.register(atexit_handler)
+ all_opt["telnet_port"] = {
+ "getopt" : "n:",
+ "longopt" : "telnet_port",
+ "help" : "-n TCP port to use (deprecated, use -u)",
+ "required" : "0",
+ "shortdesc" : "TCP port to use for connection with device (default is 3172 for telnet)",
+ "order" : 1
+ }
+ all_opt["cmd_prompt"]["default"] = "to quit:"
+
+ opt = process_input(device_opt)
+ # option -n for backward compatibility (-n is normally port no)
+ if 1 == opt.has_key("-n"):
+ opt["-u"] = opt["-n"]
+
+ # set default port for telnet only
+ if 0 == opt.has_key("-x") and 0 == opt.has_key("-u"):
+ opt["-u"] = 3172
+ options = check_input(device_opt, opt)
+
+ docs = { }
+ docs["shortdesc"] = "I/O Fencing agent for Fujitsu-Siemens RSB"
+ docs["longdesc"] = "fence_rsb is an I/O Fencing agent \
+which can be used with the Fujitsu-Siemens RSB management interface. It logs \
+into device via telnet/ssh and reboots a specified outlet. Lengthy telnet/ssh \
+connections should be avoided while a GFS cluster is running because the connection \
+will block any necessary fencing actions."
+ docs["vendorurl"] = "http://www.fujitsu.com"
+ show_docs(options, docs)
+
+ ##
+ ## Operate the fencing device
+ ####
+ print options["-u"]
+
+ conn = fence_login(options)
+ result = fence_action(conn, options, set_power_status, get_power_status, None)
+
+ ##
+ ## Logout from system
+ ##
+ ## In some special unspecified cases it is possible that
+ ## connection will be closed before we run close(). This is not
+ ## a problem because everything is checked before.
+ ######
+ try:
+ conn.sendline("0")
+ conn.close()
+ except exceptions.OSError:
+ pass
+ except pexpect.ExceptionPexpect:
+ pass
+
+ sys.exit(result)
if __name__ == "__main__":
- main()
+ main()
12 years, 5 months
fence-agents: master - fencing-agents: Add metadata output for fence agents in perl
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=com...
Commit: 664ccc6aa2fcd4b79459ca3083f8528969300a78
Parent: 8c11e2e4bf971ec75acf6cbc5b81c8efbaa273e3
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Nov 24 14:33:40 2011 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Dec 9 09:44:16 2011 +0100
fencing-agents: Add metadata output for fence agents in perl
Fencing agents written in PERL usually did not have option to print
XML metadata about its feature. Adding this feature also allow us
to generate manual pages directly from XML, so both GUI tools and manual
pages can see same feature.
Resolves: rhbz#714841 (partial)
---
fence/agents/baytech/Makefile.am | 3 +-
fence/agents/baytech/fence_baytech.8 | 84 --------------------------
fence/agents/baytech/fence_baytech.pl | 64 ++++++++++++++++++++-
fence/agents/brocade/Makefile.am | 3 +-
fence/agents/brocade/fence_brocade.8 | 84 --------------------------
fence/agents/brocade/fence_brocade.pl | 64 ++++++++++++++++++++-
fence/agents/bullpap/Makefile.am | 3 +-
fence/agents/bullpap/fence_bullpap.8 | 73 -----------------------
fence/agents/bullpap/fence_bullpap.pl | 68 ++++++++++++++++++++-
fence/agents/cpint/Makefile.am | 3 +-
fence/agents/cpint/fence_cpint.8 | 54 -----------------
fence/agents/cpint/fence_cpint.pl | 37 +++++++++++-
fence/agents/drac/Makefile.am | 3 +-
fence/agents/drac/fence_drac.8 | 105 ---------------------------------
fence/agents/drac/fence_drac.pl | 87 +++++++++++++++++++++++++++-
fence/agents/egenera/Makefile.am | 3 +-
fence/agents/egenera/fence_egenera.8 | 84 --------------------------
fence/agents/egenera/fence_egenera.pl | 61 +++++++++++++++++++
fence/agents/lib/fence2man.xsl | 4 +-
fence/agents/mcdata/Makefile.am | 3 +-
fence/agents/mcdata/fence_mcdata.8 | 84 --------------------------
fence/agents/mcdata/fence_mcdata.pl | 65 ++++++++++++++++++++-
fence/agents/vixel/Makefile.am | 3 +-
fence/agents/vixel/fence_vixel.8 | 72 ----------------------
fence/agents/vixel/fence_vixel.pl | 57 +++++++++++++++++-
fence/agents/xcat/Makefile.am | 3 +-
fence/agents/xcat/fence_xcat.8 | 63 --------------------
fence/agents/xcat/fence_xcat.pl | 56 ++++++++++++++++-
fence/agents/zvm/Makefile.am | 3 +-
fence/agents/zvm/fence_zvm.8 | 64 --------------------
fence/agents/zvm/fence_zvm.pl | 50 +++++++++++++++-
make/fencemanperl.mk | 7 ++
32 files changed, 625 insertions(+), 792 deletions(-)
diff --git a/fence/agents/baytech/Makefile.am b/fence/agents/baytech/Makefile.am
index 9ad50ec..5288efa 100644
--- a/fence/agents/baytech/Makefile.am
+++ b/fence/agents/baytech/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/baytech/fence_baytech.8 b/fence/agents/baytech/fence_baytech.8
deleted file mode 100644
index aa17955..0000000
--- a/fence/agents/baytech/fence_baytech.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_baytech 8
-
-.SH NAME
-fence_baytech - I/O Fencing agent for Baytech RPC switches in combination with a Cyclades Terminal Server
-
-.SH SYNOPSIS
-.B
-fence_baytech
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-
-This fencing agent is written for the Baytech RPC27-20nc in combination with
-a Cyclades terminal server. The Cyclades TS exports the RPC's serial port
-via a Telnet interface. Other interfaces, such as SSH, are possible.
-However, this script relies upon the assumption that Telnet is used. Future
-features to this agent would allow the agent to work with a multitude of
-different communication protocols such as Telnet, SSH or Kermit.
-
-The other assumption that is made is that Outlet names do not end in space.
-The name "Foo" and "Foo " are identical when the RPC prints them with
-the status command.
-
-fence_baytech accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_baytech
-can be run by itself with command line options which is useful for testing.
-
-Vendor URL: http://www.baytech.net
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIhost\fP
-IP address or hostname to connect to.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Username name for the switch.
-.TP
-\fB-n\fP \fIport\fP
-The name of the outlet to act upon.
-.TP
-\fB-o\fP \fIaction\fP
-The action required. This can be on, off, status or reboot (default)
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_baytech.
-.TP
-\fIhost = < hostname | ip >\fR
-IP address or hostname to connect to.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIaction = < param >\fR
-The action required. This can be on, off, status or reboot (default)
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIoutlet = < param >\fR
-The name of the outlet to act upon.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/baytech/fence_baytech.pl b/fence/agents/baytech/fence_baytech.pl
index b625968..c978ec5 100644
--- a/fence/agents/baytech/fence_baytech.pl
+++ b/fence/agents/baytech/fence_baytech.pl
@@ -63,7 +63,7 @@ sub usage
print " -D debugging output\n";
print " -h usage\n";
print " -l string user name\n";
- print " -o string action: on,off,status or reboot (default)\n";
+ print " -o string action: on,off,status, reboot (default) or metadata\n";
print " -n string outlet name\n";
print " -p string password\n";
print " -S path script to run to retrieve password\n";
@@ -96,6 +96,64 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_baytech" shortdesc="I/O Fencing agent for Baytech RPC switches in combination with a Cyclades Terminal Server" >
+<longdesc>
+This fencing agent is written for the Baytech RPC27-20nc in combination with a Cyclades terminal server. The Cyclades TS exports the RPC\'s serial port via a Telnet interface. Other interfaces, such as SSH, are possible. However, this script relies upon the assumption that Telnet is used.
+
+The other assumption that is made is that Outlet names do not end in space. The name "Foo" and "Foo " are identical when the RPC prints them with the status command.
+</longdesc>
+<vendor-url>http://www.baytech.net</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="disable" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l <name>" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="port" unique="1" required="1">
+ <getopt mixed="-n <id>" />
+ <content type="string" />
+ <shortdesc lang="en">Physical plug number or name of virtual machine</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="enable" />
+ <action name="disable" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
+
# Get operating paramters, either with getopts or from STDIN
sub get_options
{
@@ -108,6 +166,10 @@ sub get_options
fail_usage "Unkown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
} else {
get_options_stdin();
}
diff --git a/fence/agents/brocade/Makefile.am b/fence/agents/brocade/Makefile.am
index f4281ab..ed3394d 100644
--- a/fence/agents/brocade/Makefile.am
+++ b/fence/agents/brocade/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/brocade/fence_brocade.8 b/fence/agents/brocade/fence_brocade.8
deleted file mode 100644
index 812a3f9..0000000
--- a/fence/agents/brocade/fence_brocade.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_brocade 8
-
-.SH NAME
-fence_brocade - I/O Fencing agent for Brocade FC switches
-
-.SH SYNOPSIS
-.B
-fence_brocade
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_brocade is an I/O Fencing agent which can be used with Brocade FC
-switches. It logs into a Brocade switch via telnet and disables a specified
-port. Disabling the port which a machine is connected to effectively fences
-that machine. Lengthy telnet connections to the switch should be avoided
-while a GFS cluster is running because the connection will block any necessary
-fencing actions.
-
-fence_brocade accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_brocade
-can be run by itself with command line options which is useful for testing.
-
-After a fence operation has taken place the fenced machine can no longer connect
-to the Brocade FC switch. When the fenced machine is ready to be brought back
-into the GFS cluster (after reboot) the port on the Brocade FC switch needs to
-be enabled. This can be done by running fence_brocade and specifying the
-enable action.
-
-Vendor URL: http://www.brocade.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Login name for the switch.
-.TP
-\fB-n\fP \fIport\fP
-The port number to disable on the switch.
-.TP
-\fB-o\fP \fIaction\fP
-The action required. disable (default) or enable.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_brocade.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIoption = < param >\fR
-The action required. disable (default) or enable.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIport = < param >\fR
-The port number to disable on the switch.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/brocade/fence_brocade.pl b/fence/agents/brocade/fence_brocade.pl
index 933cecf..b6d3f45 100644
--- a/fence/agents/brocade/fence_brocade.pl
+++ b/fence/agents/brocade/fence_brocade.pl
@@ -40,7 +40,7 @@ sub usage
print " -h usage\n";
print " -l <name> Login name\n";
print " -n <num> Port number to operate on\n";
- print " -o <string> Action: disable (default) or enable\n";
+ print " -o <string> Action: disable (default), enable or metadata\n";
print " -p <string> Password for login\n";
print " -S <path> Script to run to retrieve password\n";
print " -q quiet mode\n";
@@ -73,6 +73,63 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_brocade" shortdesc="Fence agent for Brocade over telnet" >
+<longdesc>
+fence_brocade is an I/O Fencing agent which can be used with Brocade FC switches. It logs into a Brocade switch via telnet and disables a specified port. Disabling the port which a machine is connected to effectively fences that machine. Lengthy telnet connections to the switch should be avoided while a GFS cluster is running because the connection will block any necessary fencing actions.
+
+After a fence operation has taken place the fenced machine can no longer connect to the Brocade FC switch. When the fenced machine is ready to be brought back into the GFS cluster (after reboot) the port on the Brocade FC switch needs to be enabled. This can be done by running fence_brocade and specifying the enable action.
+</longdesc>
+<vendor-url>http://www.brocade.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="disable" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l <name>" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="port" unique="1" required="1">
+ <getopt mixed="-n <id>" />
+ <content type="string" />
+ <shortdesc lang="en">Physical plug number or name of virtual machine</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="enable" />
+ <action name="disable" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
if (@ARGV > 0) {
getopts("a:hl:n:o:p:S:qV") || fail_usage ;
@@ -82,6 +139,11 @@ if (@ARGV > 0) {
fail_usage "Unknown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
if (defined $opt_S) {
$pwd_script_out = `$opt_S`;
chomp($pwd_script_out);
diff --git a/fence/agents/bullpap/Makefile.am b/fence/agents/bullpap/Makefile.am
index a708d4f..b454007 100644
--- a/fence/agents/bullpap/Makefile.am
+++ b/fence/agents/bullpap/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/bullpap/fence_bullpap.8 b/fence/agents/bullpap/fence_bullpap.8
deleted file mode 100644
index 1404c75..0000000
--- a/fence/agents/bullpap/fence_bullpap.8
+++ /dev/null
@@ -1,73 +0,0 @@
-.TH fence_bullpap 8
-
-.SH NAME
-fence_bullpap - I/O Fencing agent for Bull FAME architecture controlled by a
-PAP management console.
-
-.SH SYNOPSIS
-.B
-fence_bullpap
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_bullpap is an I/O Fencing agent which can be used with Bull's NovaScale
-machines controlled by PAP management consoles. This agent calls Bull's
-support software provided by the NSMasterHW RPM available from Bull.
-
-fence_bullpap accepts options on the command line as well as from stdin.
-fenced sends the options through stdin when it execs the agent. fence_bullpap
-can be run by itself with command line options which is useful for testing.
-
-Vendor URL: http://www.bull.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address or hostname of the PAP management console.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Login with administrative privileges.
-.TP
-\fB-d\fP \fIdomain\fP
-This is the domain name of the Bull machine to power-cycle.
-.TP
-\fB-o\fP \fIoption\fP
-Action to perform (on, off, reboot, status).
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet operation. Only print out error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the PAP management console.
-.TP
-\fIlogin= < param >\fR
-Login with administrative privileges.
-.TP
-\fIdomain = < param >\fR
-This is the domain name of the Bull machine to power-cycle.
-.TP
-\fIoption = < param >\fR
-Action to perform (on, off, reboot, status).
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/bullpap/fence_bullpap.pl b/fence/agents/bullpap/fence_bullpap.pl
index 6915f57..3309c18 100644
--- a/fence/agents/bullpap/fence_bullpap.pl
+++ b/fence/agents/bullpap/fence_bullpap.pl
@@ -20,8 +20,6 @@ my $pname = $_;
$action = "reboot"; # Default fence action
my $bulldir = "/usr/local/bull/NSMasterHW/bin";
-stat($bulldir);
-die "NSMasterHW not installed correctly" if ! -d _;
# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and
# "#END_VERSION_GENERATION" It is generated by the Makefile
@@ -44,7 +42,7 @@ sub usage
print " -h usage\n";
print " -l <name> Login name\n";
print " -d <domain> Domain to operate on\n";
- print " -o <string> Action: on, off, reboot (default) or status\n";
+ print " -o <string> Action: on, off, reboot (default), status or metadata\n";
print " -p <string> Password for login\n";
print " -S <path> Script to run to retrieve password\n";
print " -q quiet mode\n";
@@ -86,6 +84,62 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_bullpap" shortdesc="I/O Fencing agent for Bull FAME architecture controlled by a PAP management console." >
+<longdesc>
+fence_bullpap is an I/O Fencing agent which can be used with Bull\'s NovaScale machines controlled by PAP management consoles. This agent calls Bull\'s support software provided by the NSMasterHW RPM available from Bull.
+</longdesc>
+<vendor-url>http://www.bull.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="reboot" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l <name>" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="domain" unique="1" required="1">
+ <getopt mixed="-d <domain>" />
+ <content type="string" />
+ <shortdesc lang="en">Domain name of the Bull machine to power-cycle</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="on" />
+ <action name="off" />
+ <action name="reboot" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
sub get_options_stdin
{
my $opt;
@@ -224,6 +278,11 @@ if (@ARGV > 0)
usage if defined $opt_h;
version if defined $opt_V;
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
$host = $opt_a if defined $opt_a;
$login = $opt_l if defined $opt_l;
$passwd = $opt_p if defined $opt_p;
@@ -269,6 +328,9 @@ else
fail "failed: no password" unless defined $passwd;
}
+stat($bulldir);
+die "NSMasterHW not installed correctly" if ! -d _;
+
# convert $action to lower case
$_=$action;
if (/^on$/i) { $action = "on"; }
diff --git a/fence/agents/cpint/Makefile.am b/fence/agents/cpint/Makefile.am
index c02480a..e9fee26 100644
--- a/fence/agents/cpint/Makefile.am
+++ b/fence/agents/cpint/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/cpint/fence_cpint.8 b/fence/agents/cpint/fence_cpint.8
deleted file mode 100644
index e9f1c5d..0000000
--- a/fence/agents/cpint/fence_cpint.8
+++ /dev/null
@@ -1,54 +0,0 @@
-.TH fence_cpint 8
-
-.SH NAME
-fence_cpint - I/O Fencing agent for GFS on s390 and zSeries VM clusters
-
-.SH SYNOPSIS
-.B
-fence_cpint
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_cpint is an I/O Fencing agent used on a virtual machine running GFS in a
-s390 or zSeries VM cluster.
-It uses the cpint package to send a CP LOGOFF command to the specified virtual
-machine.
-For fence_cpint to execute correctly, you must have the cpint module installed,
-and hcp in your PATH.
-\fBNOTE:\fP for fence_cpint to send a command to another virtual machine, the
-machine executing it must either be a privilege class C user or it must be
-the secondary user of the virtual machine to be fenced. This means that unless
-all of you GULM server nodes are privilege class C, fence_cpint can only be
-used with SLM.
-
-fence_cpint accepts options on the command line as well as from stdin.
-fence_node sends the options through stdin when it execs the agent.
-fence_cpint can be run by itself with command line options which is useful for
-testing.
-
-Vendor URL: http://www.ibm.com
-
-.SH OPTIONS
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-u\fP \fIuserid\fP
-userid of the virtual machine to fence (required).
-.TP
-\fB-q\fP
-quiet mode, no output.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_cpint.
-.TP
-\fIuserid = < parm >\fP
-userid of the virtual machine to fence (required).
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/cpint/fence_cpint.pl b/fence/agents/cpint/fence_cpint.pl
index dc17eed..d3c016a 100644
--- a/fence/agents/cpint/fence_cpint.pl
+++ b/fence/agents/cpint/fence_cpint.pl
@@ -36,6 +36,7 @@ sub usage
print "\n";
print "Options:\n";
print " -h usage\n";
+ print " -o metadata print XML metadata for fence agent\n";
print " -u <string> userid of the virtual machine to fence\n";
print " -q quiet mode\n";
print " -V Version\n";
@@ -66,6 +67,35 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_cpint" shortdesc="I/O Fencing agent for GFS on s390 and zSeries VM clusters" >
+<longdesc>
+fence_cpint is an I/O Fencing agent used on a virtual machine running GFS in a s390 or zSeries VM cluster. It uses the cpint package to send a CP LOGOFF command to the specified virtual machine. For fence_cpint to execute correctly, you must have the cpint module installed, and hcp in your PATH.
+
+NOTE: for fence_cpint to send a command to another virtual machine, the machine executing it must either be a privilege class C user or it must be the secondary user of the virtual machine to be fenced. This means that unless all of you GULM server nodes are privilege class C, fence_cpint can only be used with SLM.
+</longdesc>
+<vendor-url>http://www.ibm.com</vendor-url>
+<parameters>
+ <parameter name="userid" unique="1" required="1">
+ <getopt mixed="-u <userid>" />
+ <content type="string" />
+ <shortdesc lang="en">Userid of the virtual machine to fence</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
sub get_options_stdin
{
my $opt;
@@ -121,12 +151,17 @@ sub get_options_stdin
}
if (@ARGV > 0){
- getopts("hqu:V") || fail_usage;
+ getopts("hqu:Vo:") || fail_usage;
usage if defined $opt_h;
version if defined $opt_V;
fail_usage "Unkown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail_usage "No '-u' flag specified." unless defined $opt_u;
} else {
get_options_stdin();
diff --git a/fence/agents/drac/Makefile.am b/fence/agents/drac/Makefile.am
index 0a7de40..c9cdeda 100644
--- a/fence/agents/drac/Makefile.am
+++ b/fence/agents/drac/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/drac/fence_drac.8 b/fence/agents/drac/fence_drac.8
deleted file mode 100644
index 3660c5a..0000000
--- a/fence/agents/drac/fence_drac.8
+++ /dev/null
@@ -1,105 +0,0 @@
-.TH fence_drac 8
-
-.SH NAME
-fence_drac - fencing agent for Dell Remote Access Card
-
-.SH SYNOPSIS
-.B
-fence_drac
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_drac is an I/O Fencing agent which can be used with the Dell Remote
-Access Card (DRAC). This card provides remote access to controlling
-power to a server. It logs into the DRAC through the telnet interface of
-the card. By default, the telnet interface is not enabled. To enable the
-interface, you will need to use the racadm command in the racser-devel rpm
-available from Dell. To enable telnet on the DRAC:
-
-[root]# racadm config -g cfgSerial -o cfgSerialTelnetEnable 1
-
-[root]# racadm racreset
-
-fence_drac accepts options on the command line as well as from stdin.
-Fenced sends parameters through stdin when it execs the agent. fence_drac
-can be run by itself with command line options. This is useful for testing
-and for turning outlets on or off from scripts.
-
-Vendor URL: http://www.dell.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fR
-IP address or hostname of the switch.
-.TP
-\fB-c\fP \fIcmd_prompt\fR
-Force fence_drac to use cmd_prompt as the command prompt
-.TP
-\fB-d\fP \fIdracversion\fR
-Force fence_drac to treat the device as though it was for the specified drac version
-.TP
-\fB-D\fP \fIdumpfile\fR
-Debug file of the telnet interaction
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fR
-Login name.
-.TP
-\fB-m\fP \fImodulename\fR
-The module name of the blade when using DRAC/MC firmware.
-.TP
-\fB-o\fP \fIaction\fR
-The action required. reboot (default), off, on or status.
-.TP
-\fB-p\fP \fIpassword\fR
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-f\fP \fIseconds\fR
-Wait X seconds before fencing is started
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIaction = < param >\fR
-The action required. reboot (default), off, on or status.
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_apc.
-.TP
-\fIcmd_prompt = < param >\fr
-Force fence_drac to use cmd_prompt as the command prompt
-.TP
-\fIdrac_version = < param >\fr
-Force fence_drac to treat the device as though it was for the specified drac version.
-.TP
-\fIdebug = < dumpfile >\fR
-Debug file of the telnet interaction
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fImodulename = < param >\fr
-The module name of the blade when using DRAC/MC firmware.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIdelay = < param >\fR
-Wait X seconds before fencing is started
-.TP
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/drac/fence_drac.pl b/fence/agents/drac/fence_drac.pl
index e28ed98..5e1b966 100644
--- a/fence/agents/drac/fence_drac.pl
+++ b/fence/agents/drac/fence_drac.pl
@@ -74,7 +74,7 @@ sub usage
print " -h usage\n";
print " -l <name> Login name\n";
print " -m <modulename> DRAC/MC module name\n";
- print " -o <string> Action: reboot (default), off or on\n";
+ print " -o <string> Action: reboot (default), off, on or metadata\n";
print " -p <string> Login password\n";
print " -S <path> Script to run to retrieve password\n";
print " -f <seconds> Wait X seconds before fencing is started\n";
@@ -130,6 +130,86 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_drac" shortdesc="fencing agent for Dell Remote Access Card" >
+<longdesc>
+fence_drac is an I/O Fencing agent which can be used with the Dell Remote Access Card (DRAC). This card provides remote access to controlling power to a server. It logs into the DRAC through the telnet interface of the card. By default, the telnet interface is not enabled. To enable the interface, you will need to use the racadm command in the racser-devel rpm available from Dell. To enable telnet on the DRAC:
+
+[root]# racadm config -g cfgSerial -o cfgSerialTelnetEnable 1
+
+[root]# racadm racreset
+</longdesc>
+<vendor-url>http://www.dell.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="reboot" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l <name>" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="cmd_prompt" unique="1" required="0">
+ <getopt mixed="-c <prompt>" />
+ <content type="string" />
+ <shortdesc lang="en">Force fence_drac to use cmd_prompt as the command prompt</shortdesc>
+ </parameter>
+ <parameter name="drac_version" unique="1" required="0">
+ <getopt mixed="-d <version>" />
+ <content type="string" />
+ <shortdesc lang="en">Force fence_drac to treat the device as though it was for the specified drac version</shortdesc>
+ </parameter>
+ <parameter name="module_name" unique="1" required="0">
+ <getopt mixed="-m <modulename>" />
+ <content type="string"/>
+ <shortdesc lang="en">The module name of the blade when using DRAC/MC firmware.</shortdesc>
+ </parameter>
+ <parameter name="debug" unique="1" required="0">
+ <getopt mixed="-D <dumpfile>" />
+ <content type="string"/>
+ <shortdesc lang="en">Debug file of the telnet interaction</shortdesc>
+ </parameter>
+ <parameter name="delay" unique="1" required="0">
+ <getopt mixed="-f <seconds>" />
+ <content type="string" default="0"/>
+ <shortdesc lang="en">Wait X seconds before fencing is started</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="on" />
+ <action name="off" />
+ <action name="reboot" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
sub login
{
@@ -597,6 +677,11 @@ if (@ARGV > 0) {
fail_usage "Unknown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail_usage "No '-a' flag specified." unless defined $opt_a;
$address = $opt_a;
diff --git a/fence/agents/egenera/Makefile.am b/fence/agents/egenera/Makefile.am
index 5cbb555..6cd82a6 100644
--- a/fence/agents/egenera/Makefile.am
+++ b/fence/agents/egenera/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/egenera/fence_egenera.8 b/fence/agents/egenera/fence_egenera.8
deleted file mode 100644
index 3823d7c..0000000
--- a/fence/agents/egenera/fence_egenera.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_egenera 8
-
-.SH NAME
-fence_egenera - I/O Fencing agent for the Egenera BladeFrame
-
-.SH SYNOPSIS
-.B
-fence_egenera
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_egenera is an I/O Fencing agent which can be used with the Egenera
-BladeFrame. It logs into a control blade (cserver) via ssh and operates
-on a processing blade (pserver) identified by the pserver name and the
-logical process area network (LPAN) that it is in. fence_egenera requires
-that ssh keys have been setup so that the fence_egenera does not require
-a password to authenticate. Refer to ssh(8) for more information on setting
-up ssh keys.
-
-fence_egenera accepts options on the command line as well as from stdin.
-Fenced sends parameters through stdin when it execs the agent. fence_egenera
-can also be run by itself with command line options.
-
-Vendor URL: http://www.egenera.com
-
-.SH OPTIONS
-.TP
-\fB-c\fP \fIcserver\fR
-The cserver to ssh to. cserver can be in the form user@hostname to
-specify a different user to login as.
-.TP
-\fB-u\fP \fIuser\fR
-Login name. Default login name is 'root'
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlpan\fR
-the lpan to operate on
-.TP
-\fB-o\fP \fIaction\fR
-The action required. reboot (default), off, on or status.
-.TP
-\fB-p\fP \fIpserver\fR
-the pserver to operate on
-.TP
-\fB-f\fP \fIseconds\fR
-Wait X seconds before fencing is started
-.TP
-\fB-q\fP
-quite mode. suppress output.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIaction = < param >\fR
-The action required. reboot (default), off, on or status.
-.TP
-\fIuser = < param >\fR
-Login name. Default login name is 'root'
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_apc.
-.TP
-\fIcserver = < param >\fR
-The cserver to ssh to. cserver can be in the form user@hostname to
-specify a different user to login as.
-.TP
-\fIlpan = < param >\fR
-The lpan to operate on
-.TP
-\fIpserver = < param >\fR
-The pserver to operate on
-.TP
-\fIesh = < param >\fR
-The path to the esh command on the cserver (default is /opt/panmgr/bin/esh)
-.TP
-\fIdelay = < param >\fR
-Wait X seconds before fencing is started
-
-.SH SEE ALSO
-fence(8), fence_node(8), ssh(8)
diff --git a/fence/agents/egenera/fence_egenera.pl b/fence/agents/egenera/fence_egenera.pl
index f09ff32..6270cee 100644
--- a/fence/agents/egenera/fence_egenera.pl
+++ b/fence/agents/egenera/fence_egenera.pl
@@ -74,6 +74,62 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_egenera" shortdesc="I/O Fencing agent for the Egenera BladeFrame" >
+<longdesc>
+fence_egenera is an I/O Fencing agent which can be used with the Egenera BladeFrame. It logs into a control blade (cserver) via ssh and operates on a process ing blade (pserver) identified by the pserver name and the logical process area network (LPAN) that it is in. fence_egenera requires that ssh keys have been setup so that the fence_egenera does not require a password to authenticate. Refer to ssh(8) for more information on setting up ssh keys.
+</longdesc>
+<vendor-url>http://www.bull.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="reboot" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="cserver" unique="1" required="1">
+ <getopt mixed="-c <cserver>" />
+ <content type="string" />
+ <shortdesc lang="en">The cserver to ssh to. cserver can be in the form user@hostname to specify a different user to login as.</shortdesc>
+ </parameter>
+ <parameter name="pserver" unique="1" required="1">
+ <getopt mixed="-p <pserver>" />
+ <content type="string" />
+ <shortdesc lang="en">The pserver to operate on.</shortdesc>
+ </parameter>
+ <parameter name="user" unique="1" required="1">
+ <getopt mixed="-u <name>" />
+ <content type="string" default="root" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="lpan" unique="1" required="1">
+ <getopt mixed="-l <lpan>" />
+ <content type="string" />
+ <shortdesc lang="en">The lpan to operate on.</shortdesc>
+ </parameter>
+ <parameter name="delay" unique="1" required="0">
+ <getopt mixed="-f <seconds>" />
+ <content type="string" default="0"/>
+ <shortdesc lang="en">Wait X seconds before fencing is started</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="on" />
+ <action name="off" />
+ <action name="reboot" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
if (@ARGV > 0)
{
getopts("c:hl:o:p:u:qVf:") || fail_usage ;
@@ -83,6 +139,11 @@ if (@ARGV > 0)
fail_usage "Unkown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
$cserv = $opt_c if defined $opt_c;
$lpan = $opt_l if defined $opt_l;
$pserv = $opt_p if defined $opt_p;
diff --git a/fence/agents/lib/fence2man.xsl b/fence/agents/lib/fence2man.xsl
index 563b3a4..0fd71be 100644
--- a/fence/agents/lib/fence2man.xsl
+++ b/fence/agents/lib/fence2man.xsl
@@ -17,9 +17,11 @@
<xsl:choose>
<xsl:when test="@name = 'on'">Power on machine.</xsl:when>
<xsl:when test="@name = 'off'">Power off machine.</xsl:when>
+<xsl:when test="@name = 'enable'">Enable fabric access.</xsl:when>
+<xsl:when test="@name = 'disable'">Disable fabric access.</xsl:when>
<xsl:when test="@name = 'reboot'">Reboot machine.</xsl:when>
<xsl:when test="@name = 'monitor'">Check if fencing device is running. List available plugs/virtual machines or get status of machine (if it does not support more).</xsl:when>
-<xsl:when test="@name = 'meta-data'">Display the XML metadata describing this resource.</xsl:when>
+<xsl:when test="@name = 'metadata'">Display the XML metadata describing this resource.</xsl:when>
<xsl:when test="@name = 'list'">List available plugs with aliases/virtual machines if there is support for more then one device. Returns N/A otherwise.</xsl:when>
<xsl:when test="@name = 'status'">This returns the status of the plug/virtual machine.</xsl:when>
<!-- Ehhh -->
diff --git a/fence/agents/mcdata/Makefile.am b/fence/agents/mcdata/Makefile.am
index f9953f5..f1a5939 100644
--- a/fence/agents/mcdata/Makefile.am
+++ b/fence/agents/mcdata/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/mcdata/fence_mcdata.8 b/fence/agents/mcdata/fence_mcdata.8
deleted file mode 100644
index c52ffd6..0000000
--- a/fence/agents/mcdata/fence_mcdata.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_mcdata 8
-
-.SH NAME
-fence_mcdata - I/O Fencing agent for McData FC switches
-
-.SH SYNOPSIS
-.B
-fence_mcdata
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_mcdata is an I/O Fencing agent which can be used with McData FC
-switches. It logs into a McData switch via telnet and disables a specified
-port. Disabling the port which a machine is connected to effectively fences
-that machine. Lengthy telnet connections to the switch should be avoided
-while a GFS cluster is running because the connection will block any necessary
-fencing actions.
-
-fence_mcdata accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_mcdata
-can be run by itself with command line options which is useful for testing.
-
-After a fence operation has taken place the fenced machine can no longer connect
-to the McData FC switch. When the fenced machine is ready to be brought back
-into the GFS cluster (after reboot) the port on the McData FC switch needs to
-be enabled. This can be done by running fence_mcdata and specifying the
-enable action.
-
-Vendor URL: http://www.brocade.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Username name for the switch.
-.TP
-\fB-n\fP \fIport\fP
-The port number to disable on the switch.
-.TP
-\fB-o\fP \fIaction\fP
-The action required. disable (default) or enable.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_mcdata.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIoption = < param >\fR
-The action required. disable (default) or enable.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIport = < param >\fR
-The port number to disable on the switch.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/mcdata/fence_mcdata.pl b/fence/agents/mcdata/fence_mcdata.pl
index 7a01d1d..a469a1c 100644
--- a/fence/agents/mcdata/fence_mcdata.pl
+++ b/fence/agents/mcdata/fence_mcdata.pl
@@ -46,7 +46,7 @@ sub usage
print " -h usage\n";
print " -l <name> Login name\n";
print " -n <num> Port number to disable\n";
- print " -o <string> Action: disable (default) or enable\n";
+ print " -o <string> Action: disable (default), enable or metadata\n";
print " -p <string> Password for login\n";
print " -S <path> Script to run to retrieve login password\n";
print " -q quiet mode\n";
@@ -79,6 +79,64 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_mcdata" shortdesc="I/O Fencing agent for McData FC switches" >
+<longdesc>
+fence_mcdata is an I/O Fencing agent which can be used with McData FC switches. It logs into a McData switch via telnet and disables a specified port. Disabling the port which a machine is connected to effectively fences that machine. Lengthy telnet connections to the switch should be avoided while a GFS cluster is running because the connection will block any necessary fencing actions.
+
+After a fence operation has taken place the fenced machine can no longer connect to the McData FC switch. When the fenced machine is ready to be brought back into the GFS cluster (after reboot) the port on the McData FC switch needs to be enabled. This can be done by running fence_mcdata and specifying the enable action.
+</longdesc>
+<vendor-url>http://www.brocade.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="disable" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l <name>" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="port" unique="1" required="1">
+ <getopt mixed="-n <id>" />
+ <content type="string" />
+ <shortdesc lang="en">Physical plug number or name of virtual machine</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="enable" />
+ <action name="disable" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
+
sub get_options_stdin
{
my $opt;
@@ -153,6 +211,11 @@ if (@ARGV > 0) {
fail_usage "Unknown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail_usage "No '-a' flag specified." unless defined $opt_a;
fail_usage "No '-n' flag specified." unless defined $opt_n;
fail_usage "No '-l' flag specified." unless defined $opt_l;
diff --git a/fence/agents/vixel/Makefile.am b/fence/agents/vixel/Makefile.am
index f3e1339..64d6010 100644
--- a/fence/agents/vixel/Makefile.am
+++ b/fence/agents/vixel/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/vixel/fence_vixel.8 b/fence/agents/vixel/fence_vixel.8
deleted file mode 100644
index 83db14f..0000000
--- a/fence/agents/vixel/fence_vixel.8
+++ /dev/null
@@ -1,72 +0,0 @@
-.TH fence_vixel 8
-
-.SH NAME
-fence_vixel - I/O Fencing agent for Vixel FC switches
-
-.SH SYNOPSIS
-.B
-fence_vixel
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_vixel is an I/O Fencing agent which can be used with Vixel FC switches.
-It logs into a Vixel switch via telnet and removes the specified port from the
-zone. Removing the zone access from the port disables the port from being able
-to access the storage.
-
-fence_vixel accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_vixel
-can be run by itself with command line options which is useful for testing.
-
-After a fence operation has taken place the fenced machine can no longer
-connect to the Vixel FC switch. When the fenced machine is ready to be brought
-back into the GFS cluster (after reboot) the port on the Vixel FC switch needs
-to be enabled. In order to do this, log into the Vixel FC switch. Then go to:
-
-config->zones->config <port> <comma-separated-list-of-ports-in-the-zone>
-
-Then apply
-
-Consult the Vixel manual for details
-
-Vendor URL: http://www.emulex.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-n\fP \fIport\fP
-The port number to remove zoning from on the switch.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_vixel.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIport = < param >\fR
-The port number to remove zoning from on the switch.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/vixel/fence_vixel.pl b/fence/agents/vixel/fence_vixel.pl
index 470d4c7..59b9ff0 100644
--- a/fence/agents/vixel/fence_vixel.pl
+++ b/fence/agents/vixel/fence_vixel.pl
@@ -34,6 +34,7 @@ sub usage
print "Options:\n";
print " -a <ip> IP address or hostname of switch\n";
print " -h Usage\n";
+ print " -o metadata print XML metadata for fence agent\n";
print " -n <num> Port number to disable\n";
print " -p <string> Password for login\n";
print " -S <path> Script to run to retrieve login password\n";
@@ -66,14 +67,68 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_vixel" shortdesc="I/O Fencing agent for Vixel FC switches" >
+<longdesc>
+fence_vixel is an I/O Fencing agent which can be used with Vixel FC switches. It logs into a Vixel switch via telnet and removes the specified port from the zone. Removing the zone access from the port disables the port from being able to access the storage.
+
+After a fence operation has taken place the fenced machine can no longer connect to the Vixel FC switch. When the fenced machine is ready to be brought back into the GFS cluster (after reboot) the port on the Vixel FC switch needs to be enabled. In order to do this, log into the Vixel FC switch. Then go to:
+
+config->zones->config <port> <comma-separated-list-of-ports-in-the-zone>
+
+Then apply. Consult the Vixel manual for details.
+</longdesc>
+<vendor-url>http://www.emulex.com</vendor-url>
+<parameters>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="port" unique="1" required="1">
+ <getopt mixed="-n <id>" />
+ <content type="string" />
+ <shortdesc lang="en">Physical plug number or name of virtual machine</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
+
if (@ARGV > 0) {
- getopts("a:hn:p:S:V") || fail_usage ;
+ getopts("a:hn:p:S:Vo:") || fail_usage ;
usage if defined $opt_h;
version if defined $opt_V;
fail_usage "Unknown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail_usage "No '-a' flag specified." unless defined $opt_a;
if (defined $opt_S) {
diff --git a/fence/agents/xcat/Makefile.am b/fence/agents/xcat/Makefile.am
index de54526..27c289c 100644
--- a/fence/agents/xcat/Makefile.am
+++ b/fence/agents/xcat/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/xcat/fence_xcat.8 b/fence/agents/xcat/fence_xcat.8
deleted file mode 100644
index 719f896..0000000
--- a/fence/agents/xcat/fence_xcat.8
+++ /dev/null
@@ -1,63 +0,0 @@
-.TH fence_xcat 8
-
-.SH NAME
-fence_xcat - I/O Fencing agent for xcat environments
-
-.SH SYNOPSIS
-.B
-fence_xcat
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_xcat is a wrapper to the rpower(1) command that is distributed
-with the xCAT project available at http://www.xcat.org. Use of
-fence_xcat requires that xcat has already been properly configured
-for your environment. Refer to xCAT(1) for more information on
-configuring xCAT.
-
-fence_xcat accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_xcat
-can be run by itself with command line options which is useful for testing.
-
-NOTE: It is recommended that fence_bladecenter(8) is used instead of fence_xcat if
-the bladecenter firmware supports telnet. This interface is much cleaner and
-easier to setup.
-
-Vendor URL: http://www.xcat.org
-
-.SH OPTIONS
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-n\fP \fInodename\fP
-The nodename as defined in nodelist.tab of the xCAT setup.
-.TP
-\fB-o\fP \fIaction\fP
-The action required. on, off, reset (default) or stat.
-.TP
-\fB-r\fP \fIrpower\fP
-The path to the rpower binary.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_xcat.
-.TP
-\fInodename = < param >\fR
-The nodename as defined in nodelist.tab of the xCAT setup.
-.TP
-\fIaction = < param >\fR
-The action required. on, off, reset (default) or stat.
-.TP
-\fIrpower = < param >\fR
-The path to the rpower binary.
-
-.SH SEE ALSO
-fence(8), fence_node(8), fence_bladecenter(8), nodelist.tab(8), rpower(1), xCAT(1)
diff --git a/fence/agents/xcat/fence_xcat.pl b/fence/agents/xcat/fence_xcat.pl
index 2d8166a..f984ec1 100644
--- a/fence/agents/xcat/fence_xcat.pl
+++ b/fence/agents/xcat/fence_xcat.pl
@@ -38,7 +38,7 @@ sub usage
print "Options:\n";
print " -h usage\n";
print " -n <name> nodename\n";
- print " -o <string> Action: on | off | reset (default) | stat\n";
+ print " -o <string> Action: on, off, reset (default), status or metadata\n";
print " -r <rpower> rpower command\n";
print " -q quiet mode\n";
print " -V version\n";
@@ -70,6 +70,49 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_xcat" shortdesc="I/O Fencing agent for xcat environments" >
+<longdesc>
+fence_xcat is a wrapper to the rpower(1) command that is distributed with the xCAT project available at http://www.xcat.org. Use of fence_xcat requires that xcat has already been properly configured for your environment. Refer to xCAT(1) for more information on configuring xCAT.
+
+NOTE: It is recommended that fence_bladecenter(8) is used instead of fence_xcat if the bladecenter firmware supports telnet. This interface is much cleaner and easier to setup.
+</longdesc>
+<vendor-url>http://www.xcat.org</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="restart" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="nodename" unique="1" required="1">
+ <getopt mixed="-n <nodename>" />
+ <content type="string" />
+ <shortdesc lang="en">The nodename as defined in nodelist.tab of the xCAT setup.</shortdesc>
+ </parameter>
+ <parameter name="rpower" unique="1" required="0">
+ <getopt mixed="-r <rpower>" />
+ <content type="string" />
+ <shortdesc lang="en">The path to the rpower binary.</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="on" />
+ <action name="off" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
+
sub get_options_stdin
{
my $opt;
@@ -128,10 +171,15 @@ if (@ARGV > 0) {
fail_usage "Unknown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail_usage "No '-n' flag specified." unless defined $opt_n;
$opt_o=lc($opt_o);
fail_usage "Unrecognised action '$opt_o' for '-o' flag"
- unless $opt_o =~ /^(on|off|reset|stat)$/;
+ unless $opt_o =~ /^(on|off|reset|stat|status)$/;
} else {
get_options_stdin();
@@ -139,7 +187,7 @@ if (@ARGV > 0) {
fail "failed: no plug number" unless defined $opt_n;
$opt_o=lc($opt_o);
fail "failed: unrecognised action: $opt_o"
- unless $opt_o =~ /^(on|off|reset|stat)$/;
+ unless $opt_o =~ /^(on|off|reset|stat|status)$/;
}
pipe (RDR,WTR);
@@ -173,7 +221,7 @@ while (<RDR>)
{
$status = $2;
- if (($opt_o eq $2) || ($opt_o eq "stat"))
+ if (($opt_o eq $2) || ($opt_o =~ /stat/i) || ($opt_o =~ /status/i))
{
$found=1;
last;
diff --git a/fence/agents/zvm/Makefile.am b/fence/agents/zvm/Makefile.am
index a75cf66..3ce3d82 100644
--- a/fence/agents/zvm/Makefile.am
+++ b/fence/agents/zvm/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/zvm/fence_zvm.8 b/fence/agents/zvm/fence_zvm.8
deleted file mode 100644
index c58d8ae..0000000
--- a/fence/agents/zvm/fence_zvm.8
+++ /dev/null
@@ -1,64 +0,0 @@
-.TH fence_zvm 8
-
-.SH NAME
-fence_zvm - I/O Fencing agent for GFS on s390 and zSeries VM clusters
-
-.SH SYNOPSIS
-.B
-fence_zvm
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_zvm is an I/O Fencing agent used on a GFS virtual machine in a s390 or zSeries VM cluster.
-It uses the s3270 program to log the specified virtual machine out of VM.
-For fence_zvm to execute correctly, you must have s3270 in your PATH.
-
-fence_zvm accepts options on the command line as well as from stdin.
-fence_node sends the options through stdin when it execs the agent.
-fence_zvm can be run by itself with command line options which is useful
-for testing.
-
-Vendor URL: http://www.ibm.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address or hostname of the Physical machine (required).
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-u\fP \fIuserid\fP
-userid of the virtual machine to fence (required).
-.TP
-\fB-p\fP \fIpassword\fP
-password of the virtual machine to fence (required).
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password of the virtual machine to fence.
-.TP
-\fB-q\fP
-quiet mode, no output.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fP
-This option is used by fence_node(8) and is ignored by fence_zvm.
-.TP
-\fIipaddr = < hostname | ip >\fP
-IP address or hostname of the Physical machine (required).
-.TP
-\fIpasswd = < param >\fP
-password of the virtual machine to fence (required).
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password of the virtual machine to fence.
-.TP
-\fIuserid = < param >\fP
-userid of the virtual machine to fence (required).
-
-.SH SEE ALSO
-fence(8), fenced(8), fence_node(8)
diff --git a/fence/agents/zvm/fence_zvm.pl b/fence/agents/zvm/fence_zvm.pl
index f90125a..e6386e4 100644
--- a/fence/agents/zvm/fence_zvm.pl
+++ b/fence/agents/zvm/fence_zvm.pl
@@ -40,6 +40,7 @@ sub usage
print "Options:\n";
print " -a <ip> IP address or hostname of the physical s390\n";
print " -h usage\n";
+ print " -o metadata print XML metadata for fence agent\n";
print " -u <string> userid of the virtual machine to fence\n";
print " -p <string> Password\n";
print " -S <path> Script to run to retrieve login password\n";
@@ -73,6 +74,48 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_zvm" shortdesc="I/O Fencing agent for GFS on s390 and zSeries VM clusters" >
+<longdesc>
+fence_zvm is an I/O Fencing agent used on a GFS virtual machine in a s390 or zSeries VM cluster. It uses the s3270 program to log the specified virtual machine out of VM. For fence_zvm to execute correctly, you must have s3270 in your PATH.
+</longdesc>
+<vendor-url>http://www.ibm.com</vendor-url>
+<parameters>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="userid" unique="1" required="1">
+ <getopt mixed="-u <userid>" />
+ <content type="string" />
+ <shortdesc lang="en">Userid of the virtual machine to fence</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
sub do_read
{
@@ -282,12 +325,17 @@ sub get_options_stdin
}
if (@ARGV > 0){
- getopts("a:hp:S:qr:u:V") || fail_usage;
+ getopts("a:hp:S:qr:u:Vo:") || fail_usage;
usage if defined $opt_h;
version if defined $opt_V;
fail_usage "Unkown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail_usage "No '-a' flag specified." unless defined $opt_a;
if (defined $opt_S) {
diff --git a/make/fencemanperl.mk b/make/fencemanperl.mk
new file mode 100644
index 0000000..74c1508
--- /dev/null
+++ b/make/fencemanperl.mk
@@ -0,0 +1,7 @@
+%.8: $(TARGET) $(top_srcdir)/fence/agents/lib/fence2man.xsl
+ set -e && \
+ perl $(TARGET) -o metadata > .$@.tmp && \
+ xsltproc $(top_srcdir)/fence/agents/lib/fence2man.xsl .$@.tmp > $@
+
+clean-man:
+ rm -f *.8 .*.8.tmp
12 years, 5 months
cluster: RHEL58 - libgfs2: Don't count sentinel dirent as an entry
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 30f9e21706028056af6bc65555783d794a71c07f
Parent: 0f070b75b0864ed4b46c361916f822b4a57a1a3f
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Oct 5 00:18:17 2011 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Tue Dec 6 14:42:18 2011 +0000
libgfs2: Don't count sentinel dirent as an entry
dir_split_leaf() adds a sentinel dirent using dirent_alloc() which
increments di_entries in the directory dinode. Since sentinel dirents
aren't real directory entries, di_entries becomes too high in some
situations. This patch decrements di_entries after the sentinel dirent
is created to fix the discrepancy.
rhbz#745126
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/fs_ops.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index e2b4f54..6579d6f 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -926,6 +926,8 @@ static void dir_split_leaf(struct gfs2_inode *dip, uint32_t lindex,
if (dirent_alloc(dip, nbh, 0, &new))
die("dir_split_leaf (4)\n");
new->de_inum.no_formal_ino = 0;
+ /* Don't count the sentinel dirent as an entry */
+ dip->i_di.di_entries--;
}
oleaf->lf_depth = be16_to_cpu(oleaf->lf_depth) + 1;
12 years, 5 months
gfs2-utils: master - fsck: Merge strings
by cmaiolino
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: 91f331d094994cd33abcdca84e7e2989f44170fe
Parent: 3a18369266fdaf9fa2e68824da77a2886c6a3b63
Author: Carlos Maiolino <cmaiolino(a)redhat.com>
AuthorDate: Wed Dec 7 09:08:03 2011 -0200
Committer: Carlos Maiolino <cmaiolino(a)redhat.com>
CommitterDate: Wed Dec 7 09:08:03 2011 -0200
fsck: Merge strings
This patch just change some log_error calls in a way the strings can be merged
during the i18n translations, removing the amount of duplicated work to translators.
---
gfs2/fsck/fs_recovery.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index 8c3062b..1d9f632 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -456,9 +456,8 @@ static int gfs2_recover_journal(struct gfs2_inode *ip, int j, int preen,
error = gfs2_find_jhead(ip, &head);
if (error) {
if (opts.no) {
- log_err( _("Journal #%d (\"journal%d\") is corrupt.\n"
- "Not fixing it due to the -n option.\n"),
- j+1, j);
+ log_err( _("Journal #%d (\"journal%d\") is corrupt\n"),j+1, j);
+ log_err( _("Not fixing it due to the -n option.\n"));
goto out;
}
if (!preen_is_safe(sdp, preen, force_check)) {
@@ -501,13 +500,12 @@ static int gfs2_recover_journal(struct gfs2_inode *ip, int j, int preen,
return 0;
}
if (opts.no) {
- log_err(_("Journal #%d (\"journal%d\") is dirty; not replaying"
- " due to the -n option.\n"),
- j+1, j);
+ log_err(_("Journal #%d (\"journal%d\") is dirty\n"),j+1, j);
+ log_err(_("not replaying due to the -n option.\n"));
goto out;
}
if (!preen_is_safe(sdp, preen, force_check)) {
- log_err( _("Journal #%d (\"journal%d\") is dirty.\n"), j+1, j);
+ log_err( _("Journal #%d (\"journal%d\") is dirty\n"), j+1, j);
log_err( _("I'm not replaying it because it may be unsafe:\n"
"Locking protocol is not lock_nolock and "
"the -a or -p option was specified.\n"));
12 years, 5 months
cluster: the annotated tag cluster-3.1.8 has been created
by Madison Kelly
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 45d47966803f073a910521716372b32541419db9
Parent: 0000000000000000000000000000000000000000
Author: Digital Mermaid <digimer(a)lework.alteeve.com>
AuthorDate: 2011-12-07 04:12 +0000
Committer: Digital Mermaid <digimer(a)lework.alteeve.com>
CommitterDate: 2011-12-07 04:12 +0000
annotated tag: cluster-3.1.8 has been created
at 45d47966803f073a910521716372b32541419db9 (tag)
tagging 9be00f89c9b3d9670cbd73525d4c41440a37b08a (commit)
replaces cluster-3.1.7
cluster-3.1.8 release
Adam Drew (1):
rgmanager: Fix dependency restart bug in CP mode
David Teigland (2):
fenced: full check for member changes
dlm_controld: full check for member changes
Digital Mermaid (1):
Changes the kernel version check to handle 3.x.y kernels. Now if
Fabio M. Di Nitto (4):
config: make altname validation position indipendent
qdiskd: fix memcpy direction and possible memory leak
config: filterout fence_pcmk from metadata generation
config: drastically improve cman RRP configuration handling
Lon Hohberger (7):
rgmanager: Fix dependency restart bug
qdisk: Fix man page example
rgmanager: Fix dependency restart bug in CP mode
rgmanager: Clean up DBus concurrency
rgmanager: Block signals when dealing with dbus
Revert "rgmanager: Fix dependency restart bug in CP mode"
rgmanager: Send events on service stop & preserve frozen flag
12 years, 5 months
gfs2-utils: master - libgfs2: More unused bits (re)moved
by Steven Whitehouse
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: 3a18369266fdaf9fa2e68824da77a2886c6a3b63
Parent: d427382d1a9fe110357e886d99d02f639593641d
Author: Steven Whitehouse <swhiteho(a)redhat.com>
AuthorDate: Thu Dec 1 14:23:26 2011 +0000
Committer: Steven Whitehouse <swhiteho(a)redhat.com>
CommitterDate: Thu Dec 1 14:23:26 2011 +0000
libgfs2: More unused bits (re)moved
Some headers and constants which are not required are removed
and, one set of of constants which is only used internally to
a single file in the library are moved to that file.
Signed-off-by: Steven Whitehouse <swhiteho(a)redhat.com>
---
gfs2/libgfs2/fs_ops.c | 4 ++++
gfs2/libgfs2/libgfs2.h | 11 -----------
2 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index fe7fce6..e2e64d6 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -14,6 +14,10 @@
#include <linux/types.h>
#include "libgfs2.h"
+#define DATA (1)
+#define META (2)
+#define DINODE (3)
+
static __inline__ uint64_t *metapointer(struct gfs2_buffer_head *bh,
unsigned int height,
struct metapath *mp)
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index c8230d6..ef11221 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -6,9 +6,6 @@
#include <stdarg.h>
#include <stdio.h>
#include <errno.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <linux/types.h>
@@ -143,10 +140,6 @@ struct gfs2_inode {
struct gfs2_sbd *i_sbd;
};
-#define BUF_HASH_SHIFT (13) /* # hash buckets = 8K */
-#define BUF_HASH_SIZE (1 << BUF_HASH_SHIFT)
-#define BUF_HASH_MASK (BUF_HASH_SIZE - 1)
-
/* FIXME not sure that i want to keep a record of the inodes or the
* contents of them, or both ... if I need to write back to them, it
* would be easier to hold the inode as well */
@@ -275,10 +268,6 @@ struct metapath {
/* Look at this! Why can't we go bigger than 2GB? */
#define GFS2_MAX_RGSIZE (2048)
-#define DATA (1)
-#define META (2)
-#define DINODE (3)
-
/* bitmap.c */
struct gfs2_bmap {
uint64_t size;
12 years, 5 months
gfs2-utils: master - libgfs2: Clean up device geometry code
by Steven Whitehouse
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: d427382d1a9fe110357e886d99d02f639593641d
Parent: 61c1a2ba81b7cd7f529261055e9f74af1722d141
Author: Steven Whitehouse <swhiteho(a)redhat.com>
AuthorDate: Thu Dec 1 11:49:10 2011 +0000
Committer: Steven Whitehouse <swhiteho(a)redhat.com>
CommitterDate: Thu Dec 1 11:49:10 2011 +0000
libgfs2: Clean up device geometry code
The main part of this patch is the creation of a new structure
which will contain all the information that we can discover
about a device. Currently this means a struct stat plus the
results of various ioctls, and the size. A device in this case
might also be a regular file, of course.
Since all the code does is gather information, we can use the
same code in all the utilities.
The existing struct device had two fields which were unused
or almost entirely unused. Those have been removed, greatly
simplifying the code in that area.
At the same time this code also fixes a bug in the device
topology ioctls (the alignment offset and optimal i/o size
were switched in the original code).
I've done a few quick tests and all appears to be working
correctly. There should be no noticeable changes in
behaviour to the user. All the calculations should give
the same results, both before and after (aside from the ones
affected by the topology bug).
Signed-off-by: Steven Whitehouse <swhiteho(a)redhat.com>
---
gfs2/edit/hexedit.c | 11 ++--
gfs2/edit/savemeta.c | 10 +--
gfs2/fsck/initialize.c | 10 ++-
gfs2/fsck/rgrepair.c | 10 +---
gfs2/libgfs2/Makefile.am | 2 +-
gfs2/libgfs2/device_geometry.c | 149 +++++++++++++++++-----------------------
gfs2/libgfs2/fs_geometry.c | 5 +-
gfs2/libgfs2/libgfs2.h | 40 +++++------
gfs2/libgfs2/size.c | 69 ------------------
gfs2/mkfs/main_grow.c | 11 +--
gfs2/mkfs/main_mkfs.c | 53 +++++----------
11 files changed, 120 insertions(+), 250 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 952723f..267e8ca 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -1744,6 +1744,10 @@ static void read_superblock(int fd)
sbd.bsize = sbd.sd_sb.sb_bsize;
if (!sbd.bsize)
sbd.bsize = GFS2_DEFAULT_BSIZE;
+ if (lgfs2_get_dev_info(fd, &sbd.dinfo)) {
+ perror(sbd.device_name);
+ exit(-1);
+ }
compute_constants(&sbd);
if (sbd.gfs1 || (sbd.sd_sb.sb_header.mh_magic == GFS2_MAGIC &&
sbd.sd_sb.sb_header.mh_type == GFS2_METATYPE_SB))
@@ -1751,12 +1755,7 @@ static void read_superblock(int fd)
else {
block = starting_blk = 0;
}
- device_geometry(&sbd);
- if (fix_device_geometry(&sbd)) {
- fprintf(stderr, "Device is too small (%llu bytes)\n",
- (unsigned long long)sbd.device.length << GFS2_BASIC_BLOCK_SHIFT);
- exit(-1);
- }
+ fix_device_geometry(&sbd);
if(sbd.gfs1) {
sbd.sd_inptrs = (sbd.bsize - sizeof(struct gfs_indirect)) /
sizeof(uint64_t);
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 9d790fe..ed9a7b0 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -654,15 +654,11 @@ void savemeta(char *out_fn, int saveoption, int gziplevel)
if (!sbd.gfs1)
sbd.bsize = BUFSIZE;
if (!slow) {
- if (device_geometry(&sbd)) {
- fprintf(stderr, "Geometery error\n");
- exit(-1);
- }
- if (fix_device_geometry(&sbd)) {
- fprintf(stderr, "Device is too small (%llu bytes)\n",
- (unsigned long long)sbd.device.length << GFS2_BASIC_BLOCK_SHIFT);
+ if (lgfs2_get_dev_info(sbd.device_fd, &sbd.dinfo)) {
+ perror(sbd.device_name);
exit(-1);
}
+ fix_device_geometry(&sbd);
sbd.rgtree.osi_node = NULL;
if (!sbd.gfs1)
sbd.sd_sb.sb_bsize = GFS2_DEFAULT_BSIZE;
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 132d65a..a1f99d6 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -1091,7 +1091,7 @@ static int peruse_metadata(struct gfs2_sbd *sdp, uint64_t startblock)
*/
static int sb_repair(struct gfs2_sbd *sdp)
{
- uint64_t real_device_size, half;
+ uint64_t half;
uint32_t known_bsize = 0;
unsigned char uuid[16];
int error = 0;
@@ -1109,8 +1109,7 @@ static int sb_repair(struct gfs2_sbd *sdp)
log_warn(_("Block size not apparent; checking elsewhere.\n"));
/* First, figure out the device size. We need that so we can
find a suitable start point to determine what's what. */
- device_size(sdp->device_fd, &real_device_size);
- half = real_device_size / 2; /* in bytes */
+ half = sdp->dinfo.size / 2; /* in bytes */
half /= sdp->bsize;
/* Start looking halfway through the device for gfs2
structures. If there aren't any at all, forget it. */
@@ -1466,6 +1465,11 @@ int initialize(struct gfs2_sbd *sdp, int force_check, int preen,
was_mounted_ro = 1;
}
+ if (lgfs2_get_dev_info(sdp->device_fd, &sdp->dinfo)) {
+ perror(sdp->device_name);
+ return FSCK_ERROR;
+ }
+
/* read in sb from disk */
if (fill_super_block(sdp))
return FSCK_ERROR;
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index c11558b..c3467ba 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -638,15 +638,7 @@ static int gfs2_rindex_calculate(struct gfs2_sbd *sdp, int *num_rgs)
*num_rgs = sdp->md.riinode->i_di.di_size / sizeof(struct gfs2_rindex);
sdp->rgcalc.osi_node = NULL;
- if (device_geometry(sdp)) {
- fprintf(stderr, _("Geometry error\n"));
- exit(-1);
- }
- if (fix_device_geometry(sdp)) {
- fprintf(stderr, _("Device is too small (%llu bytes)\n"),
- (unsigned long long)sdp->device.length << GFS2_BASIC_BLOCK_SHIFT);
- exit(-1);
- }
+ fix_device_geometry(sdp);
/* Try all possible rgrp sizes: 2048, 1024, 512, 256, 128, 64, 32 */
for (sdp->rgsize = GFS2_DEFAULT_RGSIZE; sdp->rgsize >= 32;
diff --git a/gfs2/libgfs2/Makefile.am b/gfs2/libgfs2/Makefile.am
index bb5b0c5..ab03348 100644
--- a/gfs2/libgfs2/Makefile.am
+++ b/gfs2/libgfs2/Makefile.am
@@ -5,7 +5,7 @@ noinst_HEADERS = libgfs2.h
noinst_LTLIBRARIES = libgfs2.la
libgfs2_la_SOURCES = block_list.c fs_bits.c gfs1.c misc.c rgrp.c super.c \
- buf.c fs_geometry.c gfs2_disk_hash.c ondisk.c size.c \
+ buf.c fs_geometry.c gfs2_disk_hash.c ondisk.c \
device_geometry.c fs_ops.c gfs2_log.c recovery.c \
structures.c
diff --git a/gfs2/libgfs2/device_geometry.c b/gfs2/libgfs2/device_geometry.c
index b1ffdc3..1bee9c2 100644
--- a/gfs2/libgfs2/device_geometry.c
+++ b/gfs2/libgfs2/device_geometry.c
@@ -12,117 +12,96 @@
#include <errno.h>
#include <sys/ioctl.h>
#include <linux/types.h>
+#include <linux/fs.h>
#include "libgfs2.h"
+#ifndef BLKSSZGET
#define BLKSSZGET _IO(0x12,104) /* logical_block_size */
+#endif
+
+#ifndef BLKIOMIN
#define BLKIOMIN _IO(0x12,120) /* minimum_io_size */
+#endif
+
+#ifndef BLKIOOPT
#define BLKIOOPT _IO(0x12,121) /* optimal_io_size */
-#define BLKALIGNOFF _IO(0x12,122) /* alignment_offset */
-#define BLKPBSZGET _IO(0x12,123) /* physical_block_size */
+#endif
-/**
- * device_topology - Get the device topology
- * Values not fetched are returned as zero.
- */
-int device_topology(struct gfs2_sbd *sdp)
-{
- if (ioctl(sdp->device_fd, BLKSSZGET, &sdp->logical_block_size) < 0)
- sdp->logical_block_size = 0;
- if (ioctl(sdp->device_fd, BLKIOMIN, &sdp->minimum_io_size) < 0)
- sdp->minimum_io_size = 0;
- if (ioctl(sdp->device_fd, BLKALIGNOFF, &sdp->optimal_io_size) < 0)
- sdp->optimal_io_size = 0;
- if (ioctl(sdp->device_fd, BLKIOOPT, &sdp->alignment_offset) < 0)
- sdp->alignment_offset = 0;
- if (ioctl(sdp->device_fd, BLKPBSZGET, &sdp->physical_block_size) < 0)
- sdp->physical_block_size = 0;
- if (!sdp->debug)
- return 0;
-
- printf("\nDevice Topology:\n");
- printf(" Logical block size: %u\n", sdp->logical_block_size);
- printf(" Physical block size: %u\n", sdp->physical_block_size);
- printf(" Minimum I/O size: %u\n", sdp->minimum_io_size);
- printf(" Optimal I/O size: %u (0 means unknown)\n",
- sdp->optimal_io_size);
- printf(" Alignment offset: %u\n", sdp->alignment_offset);
- return 0;
-}
+#ifndef BLKALIGNOFF
+#define BLKALIGNOFF _IO(0x12,122) /* alignment_offset */
+#endif
-/**
- * device_geometry - Get the size of a device
- * @w: the command line
- *
- */
+#ifndef BLKPBSZGET
+#define BLKPBSZGET _IO(0x12,123) /* physical_block_size */
+#endif
-int device_geometry(struct gfs2_sbd *sdp)
+int lgfs2_get_dev_info(int fd, struct lgfs2_dev_info *i)
{
- struct device *device = &sdp->device;
- uint64_t bytes;
- int error;
+ int ret;
+ int ro = 0;
+ off_t off;
+
+ memset(i, 0, sizeof(*i));
+
+ ret = fstat(fd, &i->stat);
+ if (ret < 0)
+ return ret;
+
+ switch (i->stat.st_mode & S_IFMT) {
+ case S_IFREG:
+ i->size = i->stat.st_size;
+ ret = fcntl(fd, F_GETFL, 0);
+ if (ret & O_RDONLY)
+ i->readonly = 1;
+ i->io_optimal_size = i->stat.st_blksize;
+ goto size_check;
+ case S_IFBLK:
+ break;
+ default:
+ errno = ENOTBLK;
+ return -1;
+ }
- error = device_size(sdp->device_fd, &bytes);
- if (error)
- return error;
+ ioctl(fd, BLKRAGET, &i->ra_pages);
+ ioctl(fd, BLKBSZGET, &i->soft_block_size);
+ ioctl(fd, BLKSSZGET, &i->logical_block_size);
+ ioctl(fd, BLKIOMIN, &i->io_min_size);
+ ioctl(fd, BLKIOOPT, &i->io_optimal_size);
+ ioctl(fd, BLKPBSZGET, &i->physical_block_size);
+ ioctl(fd, BLKALIGNOFF, &i->io_align_offset);
+ ioctl(fd, BLKROGET, &ro);
+ if (ro)
+ i->readonly = 1;
+ off = lseek(fd, 0, SEEK_END);
+ if (off < 0)
+ return -1;
+ i->size = off;
- if (sdp->debug)
- printf("\nPartition size = %"PRIu64"\n",
- bytes >> GFS2_BASIC_BLOCK_SHIFT);
+size_check:
+ if (i->size < (1 << 20)) {
+ errno = ENOSPC;
+ return -1;
+ }
- device->start = 0;
- device->length = bytes >> GFS2_BASIC_BLOCK_SHIFT;
return 0;
}
/**
* fix_device_geometry - round off address and lengths and convert to FS blocks
- * @w: the command line
+ * @sdp: The super block
*
*/
-int fix_device_geometry(struct gfs2_sbd *sdp)
+void fix_device_geometry(struct gfs2_sbd *sdp)
{
struct device *device = &sdp->device;
- unsigned int bbsize = sdp->bsize >> GFS2_BASIC_BLOCK_SHIFT;
- uint64_t start, length;
- unsigned int remainder;
-
- if (sdp->debug) {
- printf("\nDevice Geometry: (in basic blocks)\n");
- printf(" start = %"PRIu64", length = %"PRIu64", rgf_flags = 0x%.8X\n",
- device->start,
- device->length,
- device->rgf_flags);
- }
-
- start = device->start;
- length = device->length;
- if (length < 1 << (20 - GFS2_BASIC_BLOCK_SHIFT)) {
- errno = ENOSPC;
- return -1;
- }
-
- remainder = start % bbsize;
- if (remainder) {
- length -= bbsize - remainder;
- start += bbsize - remainder;
- }
-
- start /= bbsize;
- length /= bbsize;
-
- device->start = start;
- device->length = length;
- sdp->device_size = start + length;
+ device->length = sdp->dinfo.size / sdp->bsize;
if (sdp->debug) {
printf("\nDevice Geometry: (in FS blocks)\n");
- printf(" start = %"PRIu64", length = %"
- PRIu64", rgf_flags = 0x%.8X\n",
- device->start, device->length, device->rgf_flags);
- printf("\nDevice Size: %"PRIu64"\n", sdp->device_size);
+ printf(" length = %"PRIu64"\n", device->length);
+ printf("\nDevice Size: %"PRIu64"\n", sdp->dinfo.size);
}
- return 0;
}
diff --git a/gfs2/libgfs2/fs_geometry.c b/gfs2/libgfs2/fs_geometry.c
index 5ff9813..fb55697 100644
--- a/gfs2/libgfs2/fs_geometry.c
+++ b/gfs2/libgfs2/fs_geometry.c
@@ -85,9 +85,6 @@ void compute_rgrp_layout(struct gfs2_sbd *sdp, struct osi_root *rgtree,
sdp->new_rgrps = 0;
dev = &sdp->device;
- /* Reserve space for the superblock */
- dev->start += sdp->sb_addr + 1;
-
/* If this is a new file system, compute the length and number */
/* of rgs based on the size of the device. */
/* If we have existing RGs (i.e. gfs2_grow) find the last one. */
@@ -128,7 +125,7 @@ void compute_rgrp_layout(struct gfs2_sbd *sdp, struct osi_root *rgtree,
rl = rgrp_insert(rgtree, rgaddr);
rl->length = rglength;
} else {
- rgaddr = dev->start;
+ rgaddr = sdp->sb_addr + 1;
rl = rgrp_insert(rgtree, rgaddr);
rl->length = dev->length -
(nrgrp - 1) * (dev->length / nrgrp);
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index b24e555..c8230d6 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -10,6 +10,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <linux/types.h>
#include <linux/limits.h>
#include <endian.h>
@@ -74,6 +75,20 @@ __BEGIN_DECLS
#define BLOCKMAP_BYTE_OFFSET4(x) ((x & 0x0000000000000001) << 2)
#define BLOCKMAP_MASK4 (0xf)
+
+struct lgfs2_dev_info {
+ struct stat stat;
+ unsigned readonly:1;
+ long ra_pages;
+ int soft_block_size;
+ int logical_block_size;
+ unsigned int physical_block_size;
+ unsigned int io_min_size;
+ unsigned int io_optimal_size;
+ int io_align_offset;
+ uint64_t size;
+};
+
static __inline__ __attribute__((noreturn, format (printf, 1, 2)))
void die(const char *fmt, ...)
{
@@ -86,9 +101,7 @@ void die(const char *fmt, ...)
}
struct device {
- uint64_t start;
uint64_t length;
- uint32_t rgf_flags;
};
struct gfs2_bitmap
@@ -208,8 +221,8 @@ struct gfs2_sbd {
int64_t time;
+ struct lgfs2_dev_info dinfo;
struct device device;
- uint64_t device_size;
int device_fd;
int path_fd;
@@ -238,12 +251,6 @@ struct gfs2_sbd {
char metafs_path[PATH_MAX]; /* where metafs is mounted */
struct special_blocks eattr_blocks;
- /* device topology information: */
- uint32_t logical_block_size;
- uint32_t minimum_io_size;
- uint32_t optimal_io_size;
- uint32_t alignment_offset;
- uint32_t physical_block_size;
uint64_t rg_one_length;
uint64_t rg_length;
int gfs1;
@@ -311,9 +318,8 @@ extern int brelse(struct gfs2_buffer_head *bh);
#define bcommit(bl) do { __bcommit(bl, __LINE__, __FUNCTION__); } while(0)
/* device_geometry.c */
-extern int device_topology(struct gfs2_sbd *sdp);
-extern int device_geometry(struct gfs2_sbd *sdp);
-extern int fix_device_geometry(struct gfs2_sbd *sdp);
+extern int lgfs2_get_dev_info(int fd, struct lgfs2_dev_info *i);
+extern void fix_device_geometry(struct gfs2_sbd *sdp);
/* fs_bits.c */
#define BFITNOENT (0xFFFFFFFF)
@@ -415,16 +421,6 @@ extern unsigned int calc_tree_height(struct gfs2_inode *ip, uint64_t size);
extern int write_journal(struct gfs2_sbd *sdp, unsigned int j,
unsigned int blocks);
-/**
- * device_size - figure out a device's size
- * @fd: the file descriptor of a device
- * @bytes: the number of bytes the device holds
- *
- * Returns: -1 on error (with errno set), 0 on success (with @bytes set)
- */
-
-extern int device_size(int fd, uint64_t *bytes);
-
/* gfs1.c - GFS1 backward compatibility structures and functions */
#define GFS_FORMAT_SB (100) /* Super-Block */
diff --git a/gfs2/libgfs2/size.c b/gfs2/libgfs2/size.c
deleted file mode 100644
index 0cff065..0000000
--- a/gfs2/libgfs2/size.c
+++ /dev/null
@@ -1,69 +0,0 @@
-#include "clusterautoconfig.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/mount.h>
-
-#include "libgfs2.h"
-
-#ifndef BLKGETSIZE64
-#define BLKGETSIZE64 _IOR(0x12, 114, size_t)
-#endif
-
-/**
- * do_device_size - determine the size of a Linux block device
- * @device: the path to the device node
- *
- * Returns: -1 on error (with errno set), 0 on success (with @bytes set)
- */
-
-static int do_device_size(int fd, uint64_t *bytes)
-{
- off_t off;
-
- off = lseek(fd, 0, SEEK_END);
- if (off >= 0) {
- *bytes = off;
- return 0;
- }
-
- return -1;
-}
-
-/**
- * device_size - figure out a device's size
- * @fd: the file descriptor of a device
- * @bytes: the number of bytes the device holds
- *
- * Returns: -1 on error (with errno set), 0 on success (with @bytes set)
- */
-
-int device_size(int fd, uint64_t *bytes)
-{
- struct stat st;
- int error;
-
- error = fstat(fd, &st);
- if (error)
- return error;
-
- if (S_ISREG(st.st_mode)) {
- *bytes = st.st_size;
- return 0;
- } else if (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode))
- return do_device_size(fd, bytes);
- else if (S_ISDIR(st.st_mode))
- errno = EISDIR;
- else
- errno = EINVAL;
-
- return -1;
-}
diff --git a/gfs2/mkfs/main_grow.c b/gfs2/mkfs/main_grow.c
index 5ed5a2d..3fe08a1 100644
--- a/gfs2/mkfs/main_grow.c
+++ b/gfs2/mkfs/main_grow.c
@@ -344,8 +344,8 @@ main_grow(int argc, char *argv[])
exit(EXIT_FAILURE);
}
- if (device_geometry(sdp)) {
- perror(_("Device geometry error"));
+ if (lgfs2_get_dev_info(sdp->device_fd, &sdp->dinfo) < 0) {
+ perror(sdp->device_name);
exit(EXIT_FAILURE);
}
log_info( _("Initializing lists...\n"));
@@ -363,12 +363,7 @@ main_grow(int argc, char *argv[])
if (sdp->gfs1) {
die( _("cannot grow gfs1 filesystem\n"));
}
- if (fix_device_geometry(sdp)) {
- fprintf(stderr, _("Device is too small (%llu bytes)\n"),
- (unsigned long long)sdp->device.length << GFS2_BASIC_BLOCK_SHIFT);
- exit(EXIT_FAILURE);
- }
-
+ fix_device_geometry(sdp);
if (mount_gfs2_meta(sdp)) {
perror("GFS2 metafs");
exit(EXIT_FAILURE);
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index 700b434..95afe41 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -336,16 +336,16 @@ static void verify_bsize(struct gfs2_sbd *sdp)
die( _("block size must be a power of two between 512 and "
"%d\n"), getpagesize());
- if (sdp->bsize < sdp->logical_block_size) {
+ if (sdp->bsize < sdp->dinfo.logical_block_size) {
die( _("Error: Block size %d is less than minimum logical "
"block size (%d).\n"), sdp->bsize,
- sdp->logical_block_size);
+ sdp->dinfo.logical_block_size);
}
- if (sdp->bsize < sdp->physical_block_size) {
+ if (sdp->bsize < sdp->dinfo.physical_block_size) {
printf( _("WARNING: Block size %d is inefficient because it "
"is less than the physical block size (%d).\n"),
- sdp->bsize, sdp->physical_block_size);
+ sdp->bsize, sdp->dinfo.physical_block_size);
if (sdp->override)
return;
@@ -528,9 +528,7 @@ void main_mkfs(int argc, char *argv[])
struct gfs2_sbd sbd, *sdp = &sbd;
int error;
int rgsize_specified = 0;
- uint64_t real_device_size;
unsigned char uuid[16];
- struct stat st_buf;
memset(sdp, 0, sizeof(struct gfs2_sbd));
sdp->bsize = -1;
@@ -555,7 +553,7 @@ void main_mkfs(int argc, char *argv[])
exit(EXIT_FAILURE);
}
- if (fstat(sdp->device_fd, &st_buf) < 0) {
+ if (lgfs2_get_dev_info(sdp->device_fd, &sdp->dinfo) < 0) {
perror(sdp->device_name);
exit(EXIT_FAILURE);
}
@@ -566,24 +564,19 @@ void main_mkfs(int argc, char *argv[])
are_you_sure();
}
- if (!S_ISREG(st_buf.st_mode) && device_topology(sdp)) {
- perror(_("Device topology error\n"));
- exit(EXIT_FAILURE);
- }
-
if (sdp->bsize == -1) {
- if (S_ISREG(st_buf.st_mode))
+ if (S_ISREG(sdp->dinfo.stat.st_mode))
sdp->bsize = GFS2_DEFAULT_BSIZE;
/* See if optimal_io_size (the biggest I/O we can submit
without incurring a penalty) is a suitable block size. */
- else if (sdp->optimal_io_size <= getpagesize() &&
- sdp->optimal_io_size >= sdp->minimum_io_size)
- sdp->bsize = sdp->optimal_io_size;
+ else if (sdp->dinfo.io_optimal_size <= getpagesize() &&
+ sdp->dinfo.io_optimal_size >= sdp->dinfo.io_min_size)
+ sdp->bsize = sdp->dinfo.io_optimal_size;
/* See if physical_block_size (the smallest unit we can write
without incurring read-modify-write penalty) is suitable. */
- else if (sdp->physical_block_size <= getpagesize() &&
- sdp->physical_block_size >= GFS2_DEFAULT_BSIZE)
- sdp->bsize = sdp->physical_block_size;
+ else if (sdp->dinfo.physical_block_size <= getpagesize() &&
+ sdp->dinfo.physical_block_size >= GFS2_DEFAULT_BSIZE)
+ sdp->bsize = sdp->dinfo.physical_block_size;
else
sdp->bsize = GFS2_DEFAULT_BSIZE;
@@ -597,13 +590,6 @@ void main_mkfs(int argc, char *argv[])
exit(EXIT_FAILURE);
}
- /* Get the device geometry */
-
- device_size(sdp->device_fd, &real_device_size);
- if (device_geometry(sdp)) {
- perror(_("Device geometry error"));
- exit(EXIT_FAILURE);
- }
/* Convert optional block-count to basic blocks */
if (sdp->orig_fssize) {
sdp->orig_fssize *= sdp->bsize;
@@ -612,18 +598,13 @@ void main_mkfs(int argc, char *argv[])
fprintf(stderr, _("%s: Specified block count is bigger "
"than the actual device.\n"), argv[0]);
die( _("Device Size is %.2f GB (%llu blocks)\n"),
- real_device_size / ((float)(1 << 30)),
- (unsigned long long)real_device_size / sdp->bsize);
+ sdp->dinfo.size / ((float)(1 << 30)),
+ (unsigned long long)sdp->dinfo.size / sdp->bsize);
}
sdp->device.length = sdp->orig_fssize;
}
- if (fix_device_geometry(sdp)) {
- fprintf(stderr, _("Device is too small (%llu bytes)\n"),
- (unsigned long long)sdp->device.length << GFS2_BASIC_BLOCK_SHIFT);
- exit(EXIT_FAILURE);
- }
-
- if (!S_ISREG(st_buf.st_mode) && discard)
+ fix_device_geometry(sdp);
+ if (!S_ISREG(sdp->dinfo.stat.st_mode) && discard)
discard_blocks(sdp);
/* Compute the resource group layouts */
@@ -698,5 +679,5 @@ void main_mkfs(int argc, char *argv[])
exit(EXIT_FAILURE);
}
- print_results(sdp, real_device_size, uuid);
+ print_results(sdp, sdp->dinfo.size, uuid);
}
12 years, 5 months
cluster: STABLE31 - config: drastically improve cman RRP configuration handling
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 991bfb0b1f547da5314141fcd79e0ea2253f78f4
Parent: 8285548a5fcab7b3cb3e6631d782816dd4f134cf
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Wed Nov 30 12:57:30 2011 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Wed Nov 30 12:57:30 2011 +0100
config: drastically improve cman RRP configuration handling
- don't allow configuration of more than 2 rings
- allow overrided of alternate mcast address and port via
envars
- when using broadcast, set different ports on second ring.
this also required a substantial change in transport handling
- add support for
<cman>
<multicast addr= port= ttl=/>
<altmulticast addr= port= ttl=/>
</cman>
- don't allow overlap of addresses/ports
- remove redundant port settings in cman
- change relaxng schema to reflect above changes
Resolves: rhbz#733298
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/daemon/cman-preconfig.c | 217 +++++++++++++++++++++-------------
config/tools/xml/cluster.rng.in.head | 64 +++++++---
2 files changed, 182 insertions(+), 99 deletions(-)
diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index fb534a9..0ced1bb 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -50,14 +50,19 @@ static char nodename[MAX_CLUSTER_MEMBER_NAME_LEN];
static int nodeid;
static int two_node;
static unsigned int disable_openais;
-static unsigned int portnum;
static int num_nodenames;
static char *key_filename=NULL;
-static char *mcast_name;
static char *cluster_name;
static char error_reason[1024] = { '\0' };
static hdb_handle_t cluster_parent_handle;
static int use_hashed_cluster_id = 0;
+static unsigned int portnum = 0;
+static unsigned int altportnum = 0;
+static char *mcast_name = NULL;
+static char *altmcast_name = NULL;
+static unsigned int ttl = 1;
+static unsigned int altttl = 1;
+
/*
* Exports the interface for the service
@@ -279,7 +284,7 @@ static int add_udpu_members(struct objdb_iface_ver0 *objdb, hdb_handle_t interfa
#define PRIMARY_IFACE 0
#define ALT_IFACE 1
-static int add_ifaddr(struct objdb_iface_ver0 *objdb, char *mcast, char *ifaddr, int port, int ttl, int altiface, enum tx_mech transport)
+static int add_ifaddr(struct objdb_iface_ver0 *objdb, char *mcast, char *ifaddr, int port, int intttl, int altiface, enum tx_mech transport)
{
hdb_handle_t totem_object_handle;
hdb_handle_t find_handle;
@@ -295,6 +300,11 @@ static int add_ifaddr(struct objdb_iface_ver0 *objdb, char *mcast, char *ifaddr,
[TX_MECH_RDMA] = "iba",
};
+ if (num_interfaces >= 2) {
+ snprintf(error_reason, sizeof(error_reason) - 1, "Configuration of more than 2 rings is not supported");
+ return -1;
+ }
+
/* Check the families match */
if (address_family(mcast, &mcast_addr, 0) !=
address_family(ifaddr, &if_addr, mcast_addr.ss_family)) {
@@ -364,14 +374,14 @@ static int add_ifaddr(struct objdb_iface_ver0 *objdb, char *mcast, char *ifaddr,
tmp, strlen(tmp)+1, OBJDB_VALUETYPE_STRING);
/* paranoia check. corosync already does it */
- if ((ttl < 0) || (ttl > 255)) {
- sprintf(error_reason, "TTL value (%u) out of range (0 - 255)", ttl);
+ if ((intttl < 0) || (intttl > 255)) {
+ sprintf(error_reason, "TTL value (%u) out of range (0 - 255)", intttl);
return -1;
}
/* add the key to the objdb only if value is not default */
- if (ttl != 1) {
- sprintf(tmp, "%d", ttl);
+ if (intttl != 1) {
+ sprintf(tmp, "%d", intttl);
objdb->object_key_create_typed(interface_object_handle, "ttl",
tmp, strlen(tmp)+1, OBJDB_VALUETYPE_STRING);
}
@@ -418,11 +428,11 @@ static char *default_mcast(char *node, int altiface)
if (family == AF_INET) {
snprintf(addr, sizeof(addr), "239.192.%d.%d", clusterid >> 8, clusterid % 0xFF);
- return addr;
+ return strdup(addr);
}
if (family == AF_INET6) {
snprintf(addr, sizeof(addr), "ff15::%x", clusterid);
- return addr;
+ return strdup(addr);
}
return NULL;
@@ -568,6 +578,11 @@ static int get_env_overrides(void)
portnum = atoi(getenv("CMAN_IP_PORT"));
}
+ /* optional alternate port */
+ if (getenv("CMAN_IP_ALTPORT")) {
+ altportnum = atoi(getenv("CMAN_IP_ALTPORT"));
+ }
+
/* optional security key filename */
if (getenv("CMAN_KEYFILE")) {
key_filename = strdup(getenv("CMAN_KEYFILE"));
@@ -591,6 +606,10 @@ static int get_env_overrides(void)
mcast_name = getenv("CMAN_MCAST_ADDR");
}
+ if (getenv("CMAN_ALTMCAST_ADDR")) {
+ altmcast_name = getenv("CMAN_ALTMCAST_ADDR");
+ }
+
if (getenv("CMAN_2NODE")) {
two_node = 1;
expected_votes = 1;
@@ -612,11 +631,15 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
hdb_handle_t object_handle;
hdb_handle_t find_handle;
hdb_handle_t node_object_handle;
+ hdb_handle_t mcast_handle;
hdb_handle_t alt_object;
enum tx_mech transport = TX_MECH_UDP;
char *str;
int error;
- unsigned int ttl = 1;
+ unsigned int mcast_portnum = DEFAULT_PORT;
+ unsigned int altmcast_portnum = DEFAULT_PORT;
+ char *altmcast_name_tmp = NULL;
+ int broadcast = 0;
if (!getenv("CMAN_NOCONFIG")) {
/* our nodename */
@@ -665,7 +688,7 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
}
/* Add <cman> bits to pass down to the main module*/
- if ( (node_object_handle = nodelist_byname(objdb, cluster_parent_handle, nodename))) {
+ if ((node_object_handle = nodelist_byname(objdb, cluster_parent_handle, nodename))) {
if (objdb_get_string(objdb, node_object_handle, "nodeid", &nodeid_str)) {
sprintf(error_reason, "This node has no nodeid in cluster.conf");
write_cman_pipe("This node has no nodeid in cluster.conf");
@@ -674,85 +697,103 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
}
objdb->object_find_create(cluster_parent_handle, "cman", strlen("cman"), &find_handle);
-
- if (objdb->object_find_next(find_handle, &object_handle) == 0) {
-
- hdb_handle_t mcast_handle;
- hdb_handle_t find_handle2;
-
- if (!mcast_name) {
-
- objdb->object_find_create(object_handle, "multicast", strlen("multicast"), &find_handle2);
- if (objdb->object_find_next(find_handle2, &mcast_handle) == 0) {
-
- objdb_get_string(objdb, mcast_handle, "addr", &mcast_name);
- objdb_get_int(objdb, mcast_handle, "ttl", &ttl, ttl);
- }
- objdb->object_find_destroy(find_handle2);
- }
-
- if (!mcast_name) {
- mcast_name = default_mcast(nodename, PRIMARY_IFACE);
-
- }
- if (!mcast_name)
- return -1;
-
- /* See if the user wants our default set of openais services (default=yes) */
- objdb_get_int(objdb, object_handle, "disable_openais", &disable_openais, 0);
-
- objdb->object_key_create_typed(object_handle, "nodename",
- nodename, strlen(nodename)+1, OBJDB_VALUETYPE_STRING);
+ if (objdb->object_find_next(find_handle, &object_handle)) {
+ sprintf(error_reason, "Unable to find cman in config db");
+ write_cman_pipe(error_reason);
+ return -1;
}
objdb->object_find_destroy(find_handle);
- nodeid = atoi(nodeid_str);
- error = 0;
-
- /* optional port */
- if (!portnum) {
- objdb_get_int(objdb, object_handle, "port", &portnum, DEFAULT_PORT);
- }
-
/* Check for broadcast */
if (!objdb_get_string(objdb, object_handle, "broadcast", &str)) {
if (strcmp(str, "yes") == 0) {
- mcast_name = strdup("255.255.255.255");
- if (!mcast_name)
- return -1;
+ broadcast = 1;
transport = TX_MECH_UDPB;
}
}
/* Check for transport */
if (!objdb_get_string(objdb, object_handle, "transport", &str)) {
+ if ((broadcast) && (strcmp(str, "udpb"))) {
+ sprintf(error_reason, "Transport and broadcast option are mutually exclusive");
+ write_cman_pipe(error_reason);
+ return -1;
+ }
if (strcmp(str, "udp") == 0) {
- if (transport != TX_MECH_UDPB) {
- transport = TX_MECH_UDP;
- }
+ transport = TX_MECH_UDP;
} else if (strcmp(str, "udpb") == 0) {
+ broadcast = 1;
transport = TX_MECH_UDPB;
} else if (strcmp(str, "udpu") == 0) {
- if (transport != TX_MECH_UDPB) {
- transport = TX_MECH_UDPU;
- } else {
- sprintf(error_reason, "Transport and broadcast option are mutually exclusive");
- write_cman_pipe("Transport and broadcast option are mutually exclusive");
- return -1;
- }
+ transport = TX_MECH_UDPU;
} else if (strcmp(str, "rdma") == 0) {
- if (transport != TX_MECH_UDPB) {
- transport = TX_MECH_RDMA;
- } else {
- sprintf(error_reason, "Transport and broadcast option are mutually exclusive");
- write_cman_pipe("Transport and broadcast option are mutually exclusive");
- return -1;
- }
+ transport = TX_MECH_RDMA;
} else {
sprintf(error_reason, "Transport option value can be one of udp, udpb, udpu, rdma");
- write_cman_pipe("Transport option value can be one of udp, udpb, udpu, rdma");
+ write_cman_pipe(error_reason);
+ return -1;
+ }
+ }
+
+ if (broadcast) {
+ mcast_name = strdup("255.255.255.255");
+ if (!mcast_name) {
+ sprintf(error_reason, "Unable to set mcast_name");
+ write_cman_pipe(error_reason);
+ return -1;
+ }
+ altmcast_name = strdup("255.255.255.255");
+ if (!altmcast_name) {
+ sprintf(error_reason, "Unable to set altmcast_name");
+ write_cman_pipe(error_reason);
return -1;
}
+ altmcast_portnum = DEFAULT_PORT + 2;
+ }
+
+ objdb->object_find_create(object_handle, "multicast", strlen("multicast"), &find_handle);
+ if (objdb->object_find_next(find_handle, &mcast_handle) == 0) {
+ if (!mcast_name)
+ objdb_get_string(objdb, mcast_handle, "addr", &mcast_name);
+ objdb_get_int(objdb, mcast_handle, "ttl", &ttl, ttl);
+ objdb_get_int(objdb, mcast_handle, "port", &mcast_portnum, DEFAULT_PORT);
+ }
+ objdb->object_find_destroy(find_handle);
+
+ if (!mcast_name) {
+ mcast_name = default_mcast(nodename, PRIMARY_IFACE);
+ }
+
+ if (!mcast_name) {
+ sprintf(error_reason, "Unable to set mcast_name");
+ write_cman_pipe(error_reason);
+ return -1;
+ }
+
+ objdb->object_find_create(object_handle, "altmulticast", strlen("altmulticast"), &find_handle);
+ if (objdb->object_find_next(find_handle, &mcast_handle) == 0) {
+ objdb_get_string(objdb, mcast_handle, "addr", &altmcast_name_tmp);
+ objdb_get_int(objdb, mcast_handle, "ttl", &altttl, ttl);
+ if (!broadcast) {
+ objdb_get_int(objdb, mcast_handle, "port", &altmcast_portnum, DEFAULT_PORT);
+ } else {
+ objdb_get_int(objdb, mcast_handle, "port", &altmcast_portnum, DEFAULT_PORT + 2);
+ }
+ }
+ objdb->object_find_destroy(find_handle);
+
+ /* See if the user wants our default set of openais services (default=yes) */
+ objdb_get_int(objdb, object_handle, "disable_openais", &disable_openais, 0);
+
+ objdb->object_key_create_typed(object_handle, "nodename",
+ nodename, strlen(nodename)+1, OBJDB_VALUETYPE_STRING);
+
+ nodeid = atoi(nodeid_str);
+ error = 0;
+
+ /* optional port */
+ if (!portnum) {
+ objdb_get_int(objdb, object_handle, "port", &portnum, mcast_portnum);
}
if (add_ifaddr(objdb, mcast_name, nodename, portnum, ttl,
@@ -765,24 +806,43 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
num_nodenames = 1;
objdb->object_find_create(node_object_handle,"altname", strlen("altname"), &find_handle);
while (objdb->object_find_next(find_handle, &alt_object) == 0) {
- unsigned int port;
- unsigned int altttl = 1;
char *node;
- char *mcast;
if (objdb_get_string(objdb, alt_object, "name", &node)) {
continue;
}
- objdb_get_int(objdb, alt_object, "port", &port, portnum);
+ objdb_get_int(objdb, alt_object, "port", &altportnum, altmcast_portnum);
- objdb_get_int(objdb, alt_object, "ttl", &altttl, ttl);
+ objdb_get_int(objdb, alt_object, "ttl", &altttl, altttl);
- if (objdb_get_string(objdb, alt_object, "mcast", &mcast)) {
- mcast = default_mcast(nodename, ALT_IFACE);
+ if (!altmcast_name) {
+ if (objdb_get_string(objdb, alt_object, "mcast", &altmcast_name)) {
+ if (altmcast_name_tmp) {
+ altmcast_name = altmcast_name_tmp;
+ } else {
+ altmcast_name = default_mcast(nodename, ALT_IFACE);
+ }
+ }
+ }
+
+ if (!altmcast_name) {
+ sprintf(error_reason, "Unable to determine alternate multicast name");
+ write_cman_pipe(error_reason);
+ return -1;
}
- if (add_ifaddr(objdb, mcast, node, portnum, altttl,
+ if (!strcmp(altmcast_name, mcast_name) &&
+ ((altportnum == portnum) || (altportnum == portnum - 1) || (portnum == altportnum - 1))) {
+ sprintf(error_reason, "Alternate communication channel (mcast: %s ports: %d,%d) cannot use\n"
+ "same address and ports of primary channel (mcast: %s ports: %d,%d)",
+ altmcast_name, altportnum, altportnum - 1,
+ mcast_name, portnum, portnum - 1);
+ write_cman_pipe(error_reason);
+ return -1;
+ }
+
+ if (add_ifaddr(objdb, altmcast_name, node, altportnum, altttl,
ALT_IFACE, transport)) {
write_cman_pipe(error_reason);
return -1;
@@ -1310,9 +1370,6 @@ static int get_cman_globals(struct objdb_iface_ver0 *objdb)
/* Get the <cman> bits that override <totem> bits */
objdb->object_find_create(cluster_parent_handle, "cman", strlen("cman"), &find_handle);
if (objdb->object_find_next(find_handle, &object_handle) == 0) {
- if (!portnum)
- objdb_get_int(objdb, object_handle, "port", &portnum, DEFAULT_PORT);
-
if (!key_filename)
objdb_get_string(objdb, object_handle, "keyfile", &key_filename);
diff --git a/config/tools/xml/cluster.rng.in.head b/config/tools/xml/cluster.rng.in.head
index 11d5052..a669c98 100644
--- a/config/tools/xml/cluster.rng.in.head
+++ b/config/tools/xml/cluster.rng.in.head
@@ -144,26 +144,25 @@ To validate your cluster.conf against this schema, run:
</optional>
<optional>
<element name="multicast" rha:description="The multicast element
- provides the ability for a user to specify a multicast address
- instead of using the multicast address generated by cman. If
+ provides the ability for a user to specify a multicast address,
+ port and TTL (Time To Live) instead of using cman defaults. If
a user does not specify a multicast address, cman creates one. It
- forms the upper 16 bits of the multicast address with 239.192 and
- forms the lower 16 bits based on the cluster ID.">
- <optional>
- <attribute name="addr" rha:description="A multicast address specified
- by a user. If you do specify a multicast address, you should
- use the 239.192.x.x series that cman uses. Otherwise, using a
- multicast address outside that range may cause unpredictable
- results. For example, using 224.0.0.x (All hosts on the network)
- may not be routed correctly, or even routed at all by some
- hardware." rha:sample="239.192.0.1"/>
- </optional>
- <optional>
- <attribute name="ttl" rha:description="Define the TTL (time to live) of
- a multicast packets. Useful only if nodes are on different subnets and
- a multicast router is available in between." rha:default="1"
- rha:sample="24"/>
- </optional>
+ forms the upper 16 bits of the multicast address with 239.192 for
+ IPv4 and ff15:: for IPv6 and forms the lower 16 bits based on
+ the cluster ID.">
+ <ref name="MULTICASTOPTS"/>
+ </element>
+ </optional>
+ <optional>
+ <element name="altmulticast" rha:description="The altmulticast element
+ provides the ability for a user to specify a multicast address,
+ port and TTL (Time To Live) instead of using cman defaults for
+ the alternate communication channel (RRP). If a user does not
+ specify an alternate multicast address, cman creates one. It
+ forms the upper 16 bits of the multicast address with 239.192 for
+ IPv4 and ff15:: for IPv6 and forms the lower 16 bits based on
+ the cluster ID + 1.">
+ <ref name="MULTICASTOPTS"/>
</element>
</optional>
</element>
@@ -1013,6 +1012,33 @@ To validate your cluster.conf against this schema, run:
</element> <!-- cluster end -->
</start>
+<!-- begin mcast definitions -->
+
+ <define name="MULTICASTOPTS">
+ <optional>
+ <attribute name="addr" rha:description="A multicast address specified
+ by a user. If you do specify a multicast address, you should
+ use the 239.192.x.x series that cman uses. Otherwise, using a
+ multicast address outside that range may cause unpredictable
+ results. For example, using 224.0.0.x (All hosts on the network)
+ may not be routed correctly, or even routed at all by some
+ hardware." rha:sample="239.192.0.1"/>
+ </optional>
+ <optional>
+ <attribute name="ttl" rha:description="Define the TTL (time to live) of
+ a multicast packets. Useful only if nodes are on different subnets and
+ a multicast router is available in between." rha:default="1"
+ rha:sample="24"/>
+ </optional>
+ <optional>
+ <attribute name="port">
+ <data type="nonNegativeInteger"/>
+ </attribute>
+ </optional>
+ </define>
+
+<!-- end mcast definitions -->
+
<!-- begin node altname definitions -->
<define name="ALTNAME">
12 years, 5 months