cluster: RHEL6 - rgmanager: OCF_NOT_INSTALLED is OK if we stop when stopped
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=b257ab953ea...
Commit: b257ab953eaa3acc20fbdd47c34579fa0282d737
Parent: c348f23fee6e4781d6150c68195528e3b7767d8e
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Thu Dec 15 15:44:26 2011 -0500
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Fri Oct 12 13:13:37 2012 -0400
rgmanager: OCF_NOT_INSTALLED is OK if we stop when stopped
Scripts often live in file systems which are mounted by
rgmanager. This patch makes rgmanager ignore the
OCF_NOT_INSTALLED error returned from the script agent if
we attempt to stop when a start failed.
Furthermore, don't mark the resource as failed if a start
failure occurs due to the program not existing.
The combination of these create the ability for a missing
script to move to a node where the script exists, or be
placed in to the stopped state.
Cherrypicked from STABLE32 (and RHEL59)
Resolves: rhbz#853251
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
Reviewed-by: Adam Drew <adrew(a)redhat.com>
Tested-by: Adam Drew <adrew(a)redhat.com>
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/daemons/restree.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/daemons/restree.c b/rgmanager/src/daemons/restree.c
index a13f907..9cd38a2 100644
--- a/rgmanager/src/daemons/restree.c
+++ b/rgmanager/src/daemons/restree.c
@@ -464,6 +464,10 @@ res_exec(resource_node_t *node, int op, const char *arg, int depth)
ret = WEXITSTATUS(ret);
+ if (node->rn_state == RES_STOPPED &&
+ op == RS_STOP && ret == OCF_RA_NOT_INSTALLED)
+ ret = 0;
+
#ifndef NO_CCS
if ((op == RS_STATUS &&
node->rn_state == RES_STARTED && ret) ||
@@ -1468,7 +1472,8 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
}
node->rn_flags &= ~(RF_NEEDSTART | RF_RECONFIG);
if (rv != 0) {
- node->rn_state = RES_FAILED;
+ if (rv != OCF_RA_NOT_INSTALLED)
+ node->rn_state = RES_FAILED;
pthread_mutex_unlock(&node->rn_resource->r_mutex);
return SFL_FAILURE;
}
11 years, 6 months
cluster: RHEL59 - fence_rhevm: Fix API changes in RHEV-M
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=b0c42d287f7...
Commit: b0c42d287f7f749794a61796f016c2e56148d64b
Parent: 432045a49e4930e6f1c406f6f279c608655dac04
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Oct 11 15:46:47 2012 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Oct 11 15:46:47 2012 +0200
fence_rhevm: Fix API changes in RHEV-M
Resolves: rhbz#863567
---
fence/agents/rhevm/fence_rhevm.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fence/agents/rhevm/fence_rhevm.py b/fence/agents/rhevm/fence_rhevm.py
index f7854f2..b05da55 100755
--- a/fence/agents/rhevm/fence_rhevm.py
+++ b/fence/agents/rhevm/fence_rhevm.py
@@ -11,7 +11,7 @@ REDHAT_COPYRIGHT=""
BUILD_DATE=""
#END_VERSION_GENERATION
-re_get_id = re.compile("<vm id=\"(.*?)\"", re.IGNORECASE);
+re_get_id = re.compile("<vm( .*)? id=\"(.*?)\"", re.IGNORECASE);
re_status = re.compile("<state>(.*?)</state>", re.IGNORECASE);
re_get_name = re.compile("<name>(.*?)</name>", re.IGNORECASE);
@@ -28,7 +28,7 @@ def get_power_status(conn, options):
# Unable to obtain ID needed to access virtual machine
fail(EC_STATUS)
- options["id"] = result.group(1);
+ options["id"] = result.group(2);
re_status.search(res)
result = re_status.search(res)
11 years, 6 months
cluster: RHEL6 - checkquorum.wdmd: add integration script with wdmd
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=c348f23fee6...
Commit: c348f23fee6e4781d6150c68195528e3b7767d8e
Parent: cdce3c1925cb75e21c79c31b60269642e98e256d
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue Oct 9 11:30:50 2012 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Wed Oct 10 10:26:04 2012 +0200
checkquorum.wdmd: add integration script with wdmd
requires wdmd >= 2.6
Resolves: rhbz#509056
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/scripts/Makefile | 2 +-
cman/scripts/checkquorum.wdmd | 104 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 105 insertions(+), 1 deletions(-)
diff --git a/cman/scripts/Makefile b/cman/scripts/Makefile
index b4866c8..7950311 100644
--- a/cman/scripts/Makefile
+++ b/cman/scripts/Makefile
@@ -1,4 +1,4 @@
-SHAREDIRTEX=checkquorum
+SHAREDIRTEX=checkquorum checkquorum.wdmd
include ../../make/defines.mk
include $(OBJDIR)/make/clean.mk
diff --git a/cman/scripts/checkquorum.wdmd b/cman/scripts/checkquorum.wdmd
new file mode 100644
index 0000000..1d81ff6
--- /dev/null
+++ b/cman/scripts/checkquorum.wdmd
@@ -0,0 +1,104 @@
+#!/bin/bash
+# Quorum detection watchdog script
+#
+# This script will return -2 if the node had quorum at one point
+# and then subsequently lost it
+#
+# Copyright 2012 Red Hat, Inc.
+
+# defaults
+
+# Amount of time in seconds to wait after quorum is lost to fail script
+waittime=60
+
+# action to take if quorum is missing for over > waittime
+# autodetect|hardreboot|crashdump|watchdog
+action=autodetect
+
+# Location of temporary file to capture timeouts
+timerfile="/var/run/cluster/checkquorum-timer"
+
+# rpm based distros
+[ -d /etc/sysconfig ] && \
+ [ -f /etc/sysconfig/checkquorum ] && \
+ . /etc/sysconfig/checkquorum
+
+# deb based distros
+[ ! -d /etc/sysconfig ] && \
+ [ -f /etc/default/checkquorum ] && \
+ . /etc/default/checkquorum
+
+has_quorum() {
+ corosync-quorumtool -s 2>/dev/null | \
+ grep ^Quorate: | \
+ grep -q Yes$
+}
+
+had_quorum() {
+ output="$(corosync-objctl 2>/dev/null | \
+ grep runtime.totem.pg.mrp.srp.operational_entered | cut -d "=" -f 2)"
+ [ -n "$output" ] && {
+ [ "$output" -ge 1 ] && return 0
+ return 1
+ }
+}
+
+take_action() {
+ case "$action" in
+ watchdog)
+ [ -n "$wdmd_action" ] && return 1
+ ;;
+ hardreboot)
+ echo 1 > /proc/sys/kernel/sysrq
+ echo b > /proc/sysrq-trigger
+ ;;
+ crashdump)
+ echo 1 > /proc/sys/kernel/sysrq
+ echo c > /proc/sysrq-trigger
+ ;;
+ autodetect)
+ service kdump status > /dev/null 2>&1
+ usekexec="$?"
+ [ -n "$wdmd_action" ] && [ "$usekexec" != "0" ] && return 1
+ echo 1 > /proc/sys/kernel/sysrq
+ [ "$usekexec" = "0" ] && echo c > /proc/sysrq-trigger
+ echo b > /proc/sysrq-trigger
+ esac
+}
+
+# watchdog uses $1 = test or = repair
+# with no arguments we are called by wdmd
+[ -z "$1" ] && wdmd_action=yes
+
+# we don't support watchdog repair action
+[ "$1" = "repair" ] && exit 1
+
+service corosync status > /dev/null 2>&1
+ret=$?
+
+case "$ret" in
+ 3) # corosync is not running (clean)
+ rm -f "$timerfile"
+ exit 0
+ ;;
+ 1) # corosync crashed or did exit abonormally (dirty - take action)
+ logger -t checkquorum.wdmd "corosync crashed or exited abonarmally. Node will soon reboot"
+ take_action
+ ;;
+ 0) # corosync is running (clean)
+ # check quorum here
+ has_quorum && {
+ echo -e "oldtime=$(date +%s)" > "$timerfile"
+ exit 0
+ }
+ . "$timerfile"
+ newtime="$(date +%s)"
+ delta=$((newtime - oldtime))
+ logger -t checkquorum.wdmd "Node has lost quorum. Node will soon reboot"
+ had_quorum && [ "$delta" -gt "$waittime" ] && {
+ take_action
+ }
+ ;;
+esac
+
+exit $?
11 years, 6 months
cluster: RHEL6 - cman init: make sure we start after fence_sanlockd and warn users
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=cdce3c1925c...
Commit: cdce3c1925cb75e21c79c31b60269642e98e256d
Parent: 5fa8099c3dad18712941a5fbea1379a6e2ffdadd
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue Oct 9 11:28:43 2012 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Wed Oct 10 10:25:58 2012 +0200
cman init: make sure we start after fence_sanlockd and warn users
Resolves: rhbz#509056
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/init.d/cman.in | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index b64bb17..0f40097 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -8,8 +8,8 @@
#
### BEGIN INIT INFO
# Provides: cman
-# Required-Start: $network $time
-# Required-Stop: $network $time
+# Required-Start: $network $time fence_sanlockd
+# Required-Stop: $network $time fence_sanlockd
# Default-Start:
# Default-Stop:
# Short-Description: Starts and stops cman
@@ -678,6 +678,13 @@ stop_cmannotifyd()
stop_daemon cmannotifyd
}
+fence_sanlock_check()
+{
+ service fence_sanlockd status > /dev/null 2>&1 &&
+ echo " fence_sanlockd detected. Unfencing might take several minutes!"
+ return 0
+}
+
unfence_self()
{
# fence_node returns 0 on success, 1 on failure, 2 if unconfigured
@@ -818,6 +825,8 @@ start()
[ "$breakpoint" = "daemons" ] && exit 0
+ fence_sanlock_check
+
runwrap unfence_self \
none \
"Unfencing self"
11 years, 6 months
cluster: STABLE32 - checkquorum.wdmd: add integration script with wdmd
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=cdd37c317a1...
Commit: cdd37c317a1b0ebfb4daaf56f5a6beac20356792
Parent: f478706e70f45bee691cfedd6177226a81aedd16
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue Oct 9 11:30:50 2012 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue Oct 9 11:30:50 2012 +0200
checkquorum.wdmd: add integration script with wdmd
requires wdmd >= 2.6
Resolves: rhbz#509056
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/scripts/Makefile | 2 +-
cman/scripts/checkquorum.wdmd | 104 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 105 insertions(+), 1 deletions(-)
diff --git a/cman/scripts/Makefile b/cman/scripts/Makefile
index b4866c8..7950311 100644
--- a/cman/scripts/Makefile
+++ b/cman/scripts/Makefile
@@ -1,4 +1,4 @@
-SHAREDIRTEX=checkquorum
+SHAREDIRTEX=checkquorum checkquorum.wdmd
include ../../make/defines.mk
include $(OBJDIR)/make/clean.mk
diff --git a/cman/scripts/checkquorum.wdmd b/cman/scripts/checkquorum.wdmd
new file mode 100644
index 0000000..1d81ff6
--- /dev/null
+++ b/cman/scripts/checkquorum.wdmd
@@ -0,0 +1,104 @@
+#!/bin/bash
+# Quorum detection watchdog script
+#
+# This script will return -2 if the node had quorum at one point
+# and then subsequently lost it
+#
+# Copyright 2012 Red Hat, Inc.
+
+# defaults
+
+# Amount of time in seconds to wait after quorum is lost to fail script
+waittime=60
+
+# action to take if quorum is missing for over > waittime
+# autodetect|hardreboot|crashdump|watchdog
+action=autodetect
+
+# Location of temporary file to capture timeouts
+timerfile="/var/run/cluster/checkquorum-timer"
+
+# rpm based distros
+[ -d /etc/sysconfig ] && \
+ [ -f /etc/sysconfig/checkquorum ] && \
+ . /etc/sysconfig/checkquorum
+
+# deb based distros
+[ ! -d /etc/sysconfig ] && \
+ [ -f /etc/default/checkquorum ] && \
+ . /etc/default/checkquorum
+
+has_quorum() {
+ corosync-quorumtool -s 2>/dev/null | \
+ grep ^Quorate: | \
+ grep -q Yes$
+}
+
+had_quorum() {
+ output="$(corosync-objctl 2>/dev/null | \
+ grep runtime.totem.pg.mrp.srp.operational_entered | cut -d "=" -f 2)"
+ [ -n "$output" ] && {
+ [ "$output" -ge 1 ] && return 0
+ return 1
+ }
+}
+
+take_action() {
+ case "$action" in
+ watchdog)
+ [ -n "$wdmd_action" ] && return 1
+ ;;
+ hardreboot)
+ echo 1 > /proc/sys/kernel/sysrq
+ echo b > /proc/sysrq-trigger
+ ;;
+ crashdump)
+ echo 1 > /proc/sys/kernel/sysrq
+ echo c > /proc/sysrq-trigger
+ ;;
+ autodetect)
+ service kdump status > /dev/null 2>&1
+ usekexec="$?"
+ [ -n "$wdmd_action" ] && [ "$usekexec" != "0" ] && return 1
+ echo 1 > /proc/sys/kernel/sysrq
+ [ "$usekexec" = "0" ] && echo c > /proc/sysrq-trigger
+ echo b > /proc/sysrq-trigger
+ esac
+}
+
+# watchdog uses $1 = test or = repair
+# with no arguments we are called by wdmd
+[ -z "$1" ] && wdmd_action=yes
+
+# we don't support watchdog repair action
+[ "$1" = "repair" ] && exit 1
+
+service corosync status > /dev/null 2>&1
+ret=$?
+
+case "$ret" in
+ 3) # corosync is not running (clean)
+ rm -f "$timerfile"
+ exit 0
+ ;;
+ 1) # corosync crashed or did exit abonormally (dirty - take action)
+ logger -t checkquorum.wdmd "corosync crashed or exited abonarmally. Node will soon reboot"
+ take_action
+ ;;
+ 0) # corosync is running (clean)
+ # check quorum here
+ has_quorum && {
+ echo -e "oldtime=$(date +%s)" > "$timerfile"
+ exit 0
+ }
+ . "$timerfile"
+ newtime="$(date +%s)"
+ delta=$((newtime - oldtime))
+ logger -t checkquorum.wdmd "Node has lost quorum. Node will soon reboot"
+ had_quorum && [ "$delta" -gt "$waittime" ] && {
+ take_action
+ }
+ ;;
+esac
+
+exit $?
11 years, 6 months
cluster: STABLE32 - cman init: make sure we start after fence_sanlockd and warn users
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=f478706e70f...
Commit: f478706e70f45bee691cfedd6177226a81aedd16
Parent: 5a4cc0c888396c4efc8d7f6ffffd0e960b5259cb
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue Oct 9 11:28:43 2012 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue Oct 9 11:28:43 2012 +0200
cman init: make sure we start after fence_sanlockd and warn users
Resolves: rhbz#509056
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/init.d/cman.in | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index a88f52f..849739b 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -8,8 +8,8 @@
#
### BEGIN INIT INFO
# Provides: cman
-# Required-Start: $network $time
-# Required-Stop: $network $time
+# Required-Start: $network $time fence_sanlockd
+# Required-Stop: $network $time fence_sanlockd
# Default-Start:
# Default-Stop:
# Short-Description: Starts and stops cman
@@ -740,6 +740,13 @@ stop_cmannotifyd()
stop_daemon cmannotifyd
}
+fence_sanlock_check()
+{
+ service fence_sanlockd status > /dev/null 2>&1 &&
+ echo " fence_sanlockd detected. Unfencing might take several minutes!"
+ return 0
+}
+
unfence_self()
{
# fence_node returns 0 on success, 1 on failure, 2 if unconfigured
@@ -881,6 +888,8 @@ start()
[ "$breakpoint" = "daemons" ] && exit 0
+ fence_sanlock_check
+
runwrap unfence_self \
none \
"Unfencing self"
11 years, 6 months
fence-agents: RHEL6 - fence_rhevm: fix typo in RE
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=825ca4...
Commit: 825ca4f88958060fb408ba0e1798e1eef58426d3
Parent: a98e0b19e31a05e69c4347f6cd39714e8a2c72a3
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Tue Oct 9 11:21:06 2012 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Tue Oct 9 11:22:24 2012 +0200
fence_rhevm: fix typo in RE
Resolves: rhbz#863568
---
fence/agents/rhevm/fence_rhevm.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fence/agents/rhevm/fence_rhevm.py b/fence/agents/rhevm/fence_rhevm.py
index fa75030..4310dd0 100644
--- a/fence/agents/rhevm/fence_rhevm.py
+++ b/fence/agents/rhevm/fence_rhevm.py
@@ -12,7 +12,7 @@ BUILD_DATE="March, 2008"
#END_VERSION_GENERATION
-re_get_id = re.compile("<vm( .*)? id=\"(.*?)\"", re.IGNORECASE);
+re_get_id = re.compile("<vm( .*)? id=\"(.*?)\"", re.IGNORECASE);
re_status = re.compile("<state>(.*?)</state>", re.IGNORECASE);
re_get_name = re.compile("<name>(.*?)</name>", re.IGNORECASE);
11 years, 6 months
fence-agents: master - fence_rhevm: fix typo in RE
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=dd0e31...
Commit: dd0e31de6cd4dd6926effaee8824eccc79bbf2a1
Parent: 2233dbef63729fca7bd74ec4ef93b3a649e149f6
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Tue Oct 9 11:21:06 2012 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Tue Oct 9 11:21:06 2012 +0200
fence_rhevm: fix typo in RE
Resolves: rhbz#863568
---
fence/agents/rhevm/fence_rhevm.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fence/agents/rhevm/fence_rhevm.py b/fence/agents/rhevm/fence_rhevm.py
index fa75030..4310dd0 100644
--- a/fence/agents/rhevm/fence_rhevm.py
+++ b/fence/agents/rhevm/fence_rhevm.py
@@ -12,7 +12,7 @@ BUILD_DATE="March, 2008"
#END_VERSION_GENERATION
-re_get_id = re.compile("<vm( .*)? id=\"(.*?)\"", re.IGNORECASE);
+re_get_id = re.compile("<vm( .*)? id=\"(.*?)\"", re.IGNORECASE);
re_status = re.compile("<state>(.*?)</state>", re.IGNORECASE);
re_get_name = re.compile("<name>(.*?)</name>", re.IGNORECASE);
11 years, 6 months
cluster: RHEL6 - rgmanager: Fix a crash when dbus notifications are enabled
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=5fa8099c3da...
Commit: 5fa8099c3dad18712941a5fbea1379a6e2ffdadd
Parent: de7ae8fdcd3b46a23affbbe397f3e14462e0c905
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Fri May 18 07:30:31 2012 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Mon Oct 8 10:27:42 2012 -0400
rgmanager: Fix a crash when dbus notifications are enabled
dbus doesn't lock internal data unless dbus_threads_init
is called.
Acked-by: Lon Hohberger <lhh(a)redhat.com>
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/daemons/update-dbus.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/daemons/update-dbus.c b/rgmanager/src/daemons/update-dbus.c
index e706746..474140e 100644
--- a/rgmanager/src/daemons/update-dbus.c
+++ b/rgmanager/src/daemons/update-dbus.c
@@ -69,6 +69,7 @@ rgm_dbus_init(void)
return 0;
}
+ dbus_threads_init_default();
dbus_error_init(&err);
dbc = dbus_bus_get_private(DBUS_BUS_SYSTEM, &err);
11 years, 6 months
fence-agents: RHEL6 - fence agents: Some agents do not support action=metadata on STDIN
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=a98e0b...
Commit: a98e0b19e31a05e69c4347f6cd39714e8a2c72a3
Parent: fec1c4b83857a302a8423ef2070977a7e900ca99
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Jul 12 18:30:48 2012 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Mon Oct 8 14:06:51 2012 +0200
fence agents: Some agents do not support action=metadata on STDIN
Resolves rhbz#837174
---
fence/agents/baytech/fence_baytech.pl | 9 +++++----
fence/agents/brocade/fence_brocade.pl | 5 +++++
fence/agents/bullpap/fence_bullpap.pl | 7 ++++++-
fence/agents/cpint/fence_cpint.pl | 10 ++++++++++
fence/agents/drac/fence_drac.pl | 5 +++++
fence/agents/egenera/fence_egenera.pl | 9 +++++----
fence/agents/mcdata/fence_mcdata.pl | 7 ++++++-
fence/agents/rackswitch/do_rack.c | 9 +++++++++
fence/agents/xcat/fence_xcat.pl | 5 +++++
fence/agents/zvm/fence_zvm.pl | 10 ++++++++++
10 files changed, 66 insertions(+), 10 deletions(-)
diff --git a/fence/agents/baytech/fence_baytech.pl b/fence/agents/baytech/fence_baytech.pl
index c978ec5..e218b78 100644
--- a/fence/agents/baytech/fence_baytech.pl
+++ b/fence/agents/baytech/fence_baytech.pl
@@ -166,14 +166,15 @@ 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();
}
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail "failed: must specify hostname" unless defined $opt_a;
$host=$opt_a;
$port=23 unless ($opt_a =~ /:/);
diff --git a/fence/agents/brocade/fence_brocade.pl b/fence/agents/brocade/fence_brocade.pl
index e3d1612..e3f7290 100644
--- a/fence/agents/brocade/fence_brocade.pl
+++ b/fence/agents/brocade/fence_brocade.pl
@@ -162,6 +162,11 @@ if (@ARGV > 0) {
} else {
get_options_stdin();
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail "failed: no IP address" unless defined $opt_a;
fail "failed: no plug number" unless defined $opt_n;
fail "failed: no login name" unless defined $opt_l;
diff --git a/fence/agents/bullpap/fence_bullpap.pl b/fence/agents/bullpap/fence_bullpap.pl
index 3309c18..e31ab6d 100644
--- a/fence/agents/bullpap/fence_bullpap.pl
+++ b/fence/agents/bullpap/fence_bullpap.pl
@@ -179,7 +179,7 @@ sub get_options_stdin
{
$login = $val;
}
- elsif ($name eq "option" )
+ elsif (($name eq "option" ) || ($name eq "action"))
{
$action = $val;
}
@@ -312,6 +312,11 @@ else
{
get_options_stdin();
+ if ((defined $action) && ($action =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail "failed: no IP address" unless defined $host;
fail "failed: no domain" unless defined $domain;
fail "failed: no login name" unless defined $login;
diff --git a/fence/agents/cpint/fence_cpint.pl b/fence/agents/cpint/fence_cpint.pl
index d3c016a..eb2ad3a 100644
--- a/fence/agents/cpint/fence_cpint.pl
+++ b/fence/agents/cpint/fence_cpint.pl
@@ -142,6 +142,11 @@ sub get_options_stdin
$opt_u = $val;
}
+ elsif ($name eq "action" )
+ {
+ $opt_o = $val;
+ }
+
else
{
print stderr "parse error: unknown option \"$opt\"\n";
@@ -166,6 +171,11 @@ if (@ARGV > 0){
} else {
get_options_stdin();
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail "no userid" unless defined $opt_u;
}
diff --git a/fence/agents/drac/fence_drac.pl b/fence/agents/drac/fence_drac.pl
index 825391f..b26fbcb 100644
--- a/fence/agents/drac/fence_drac.pl
+++ b/fence/agents/drac/fence_drac.pl
@@ -717,6 +717,11 @@ if (@ARGV > 0) {
} else {
get_options_stdin();
+ if ((defined $action) && ($action =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail "failed: no IP address" unless defined $address;
fail "failed: no login name" unless defined $login;
diff --git a/fence/agents/egenera/fence_egenera.pl b/fence/agents/egenera/fence_egenera.pl
index 30eaca1..308338b 100644
--- a/fence/agents/egenera/fence_egenera.pl
+++ b/fence/agents/egenera/fence_egenera.pl
@@ -139,10 +139,6 @@ 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;
@@ -156,6 +152,11 @@ else
get_options_stdin();
}
+if (((defined $opt_o) && ($opt_o =~ /metadata/i)) || ((defined $action) && ($action =~ /metadata/i))) {
+ print_metadata();
+ exit 0;
+}
+
$action = "reboot" unless defined $action;
$user = "root" unless defined $user;
diff --git a/fence/agents/mcdata/fence_mcdata.pl b/fence/agents/mcdata/fence_mcdata.pl
index a469a1c..5bc9dcf 100644
--- a/fence/agents/mcdata/fence_mcdata.pl
+++ b/fence/agents/mcdata/fence_mcdata.pl
@@ -176,7 +176,7 @@ sub get_options_stdin
{
$opt_l = $val;
}
- elsif ($name eq "option" )
+ elsif (($name eq "option" ) || ($name eq "action"))
{
$opt_o = $val;
}
@@ -235,6 +235,11 @@ if (@ARGV > 0) {
} else {
get_options_stdin();
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail "failed: no IP address" unless defined $opt_a;
fail "failed: no plug number" unless defined $opt_n;
fail "failed: no login name" unless defined $opt_l;
diff --git a/fence/agents/rackswitch/do_rack.c b/fence/agents/rackswitch/do_rack.c
index 67d24a2..d8050bf 100644
--- a/fence/agents/rackswitch/do_rack.c
+++ b/fence/agents/rackswitch/do_rack.c
@@ -301,6 +301,15 @@ static void get_options(int argc, char **argv)
strcpy(name, pname);
if (!strcmp(arg, "ipaddr"))
strcpy(ipaddr, value);
+
+ if (!strcmp(arg, "action"))
+ if (strncasecmp(value, "metadata", 254) == 0) {
+ print_metadata();
+ exit(DID_SUCCESS);
+ } else {
+ fprintf(stderr, "Only 'metadata' option is aviable for this fence agent\n");
+ exit(DID_FAILURE);
+ }
if (!strcmp(arg, "portnumber"))
strcpy(portnumber, value);
diff --git a/fence/agents/xcat/fence_xcat.pl b/fence/agents/xcat/fence_xcat.pl
index f984ec1..3cd16aa 100644
--- a/fence/agents/xcat/fence_xcat.pl
+++ b/fence/agents/xcat/fence_xcat.pl
@@ -184,6 +184,11 @@ if (@ARGV > 0) {
} else {
get_options_stdin();
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail "failed: no plug number" unless defined $opt_n;
$opt_o=lc($opt_o);
fail "failed: unrecognised action: $opt_o"
diff --git a/fence/agents/zvm/fence_zvm.pl b/fence/agents/zvm/fence_zvm.pl
index e6386e4..04a29e2 100644
--- a/fence/agents/zvm/fence_zvm.pl
+++ b/fence/agents/zvm/fence_zvm.pl
@@ -299,6 +299,11 @@ sub get_options_stdin
{
$opt_r = $val;
}
+
+ elsif ($name eq "action")
+ {
+ $opt_o = $val;
+ }
# FIXME -- depreicated residue of old fencing system
elsif ($name eq "name" ) { }
@@ -352,6 +357,11 @@ if (@ARGV > 0){
} else {
get_options_stdin();
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail "no IP address" unless defined $opt_a;
fail "no userid" unless defined $opt_u;
11 years, 6 months