cluster: RHEL6 - gfs2_grow: report bad return codes on error
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=f50e499e44e...
Commit: f50e499e44e5c7f1920e93c9b26b61c8c8468d48
Parent: 05bc9dc0345966bfbc6ade0ea9520206379d0068
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Mon Dec 17 09:05:30 2012 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Apr 25 11:40:12 2013 -0700
gfs2_grow: report bad return codes on error
This patch changes gfs2_grow so that if errors are encountered
during the gfs2_grow process, the return code for the command
will more accurately reflect the error. It will no longer report
a good return code if an error occurred.
rhbz#886585
---
gfs2/mkfs/main_grow.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/gfs2/mkfs/main_grow.c b/gfs2/mkfs/main_grow.c
index 06d8cba..8839953 100644
--- a/gfs2/mkfs/main_grow.c
+++ b/gfs2/mkfs/main_grow.c
@@ -294,6 +294,7 @@ main_grow(int argc, char *argv[])
struct gfs2_sbd sbd, *sdp = &sbd;
int rgcount, rindex_fd;
char rindex_name[PATH_MAX];
+ int error = EXIT_SUCCESS;
memset(sdp, 0, sizeof(struct gfs2_sbd));
sdp->bsize = GFS2_DEFAULT_BSIZE;
@@ -375,6 +376,7 @@ main_grow(int argc, char *argv[])
fssize = filesystem_size(sdp);
if (!sdp->rgtree.osi_node) {
log_err(_("Error: No resource groups found.\n"));
+ error = -EXIT_FAILURE;
goto out;
}
last_rgrp = (struct rgrp_tree *)osi_last(&sdp->rgtree);
@@ -388,8 +390,9 @@ main_grow(int argc, char *argv[])
fsgrowth / MB);
log_err( _("One RG is %uMB for this file system.\n"),
(rgsize * sdp->bsize) / MB);
- }
- else {
+ error = -EXIT_FAILURE;
+ goto out;
+ } else {
int old_rg_count;
compute_rgrp_layout(sdp, &sdp->rgtree, TRUE);
@@ -407,4 +410,5 @@ main_grow(int argc, char *argv[])
close(sdp->path_fd);
sync();
log_notice( _("gfs2_grow complete.\n"));
+ exit(error);
}
10 years, 12 months
gfs2-utils: master - gfs2_grow: report bad return codes on error
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=457c8b61...
Commit: 457c8b6139c5c277db5a8b1a4a8d81aefeded05a
Parent: 4d4c96cbb24a58b54a198e01044e7cce161ea323
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Mon Dec 17 09:05:30 2012 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Apr 25 11:57:30 2013 -0700
gfs2_grow: report bad return codes on error
This patch changes gfs2_grow so that if errors are encountered
during the gfs2_grow process, the return code for the command
will more accurately reflect the error. It will no longer report
a good return code if an error occurred.
---
gfs2/mkfs/main_grow.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/gfs2/mkfs/main_grow.c b/gfs2/mkfs/main_grow.c
index c52f78d..73c7f84 100644
--- a/gfs2/mkfs/main_grow.c
+++ b/gfs2/mkfs/main_grow.c
@@ -322,6 +322,7 @@ main_grow(int argc, char *argv[])
struct gfs2_sbd sbd, *sdp = &sbd;
int rgcount, rindex_fd;
char rindex_name[PATH_MAX];
+ int error = EXIT_SUCCESS;
memset(sdp, 0, sizeof(struct gfs2_sbd));
sdp->bsize = GFS2_DEFAULT_BSIZE;
@@ -400,6 +401,7 @@ main_grow(int argc, char *argv[])
fssize = filesystem_size(sdp);
if (!sdp->rgtree.osi_node) {
log_err(_("Error: No resource groups found.\n"));
+ error = -EXIT_FAILURE;
goto out;
}
last_rgrp = (struct rgrp_tree *)osi_last(&sdp->rgtree);
@@ -413,8 +415,9 @@ main_grow(int argc, char *argv[])
(unsigned long long)fsgrowth / MB);
log_err( _("One resource group is %uMB for this file system.\n"),
(rgsize * sdp->bsize) / MB);
- }
- else {
+ error = -EXIT_FAILURE;
+ goto out;
+ } else {
int old_rg_count;
compute_rgrp_layout(sdp, &sdp->rgtree, TRUE);
@@ -433,4 +436,5 @@ main_grow(int argc, char *argv[])
close(sdp->path_fd);
sync();
log_notice( _("gfs2_grow complete.\n"));
+ exit(error);
}
10 years, 12 months
cluster: RHEL510 - fenced: additional fixes for /dev/zero bug
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=d45ceaa6e24...
Commit: d45ceaa6e243733f801ce6aa8519d741a1801e34
Parent: 334a6b9cb3cda250444c8d3192d3ab33e70ad923
Author: Christine Caulfield <ccaulfie(a)redhat.com>
AuthorDate: Fri Apr 19 08:47:29 2013 +0100
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Fri Apr 19 08:47:29 2013 +0100
fenced: additional fixes for /dev/zero bug
Patch 60dd70f06444939ea14bb6a40cfb61ab1eea9616 was not the full
fix for that bug. This patch fixes one place where the correct
fd was not updated and also corrects the shutdown code so
that it's not dependant on which fd (zero or cman) is active.
Resolves rhbz#951049
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
---
fence/fenced/main.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fence/fenced/main.c b/fence/fenced/main.c
index 72961f5..3163905 100644
--- a/fence/fenced/main.c
+++ b/fence/fenced/main.c
@@ -549,11 +549,11 @@ static int loop(void)
client_add(groupd_fd, &maxi);
log_debug("listen %d member %d groupd %d",
- listen_fd, member_fd, groupd_fd);
+ listen_fd, client[cluster_fd_pos].fd, groupd_fd);
for (;;) {
/* We need to re-get the cluster FD eac time */
- pollfd[cluster_fd_pos].fd = get_member_fd();
+ pollfd[cluster_fd_pos].fd = client[cluster_fd_pos].fd = get_member_fd();
rv = poll(pollfd, maxi + 1, -1);
if (rv < 0) {
if (errno == EINTR)
@@ -575,7 +575,7 @@ static int loop(void)
if (client[i].fd < 0)
continue;
if (pollfd[i].revents & (POLLERR | POLLHUP | POLLNVAL)) {
- if (pollfd[i].fd == member_fd) {
+ if (i == cluster_fd_pos) {
log_error("cluster is down, exiting");
exit(1);
}
@@ -587,7 +587,7 @@ static int loop(void)
} else if (pollfd[i].revents & POLLIN) {
if (pollfd[i].fd == groupd_fd)
process_groupd();
- else if (pollfd[i].fd == member_fd)
+ else if (i == cluster_fd_pos)
process_member();
else
client_process(i);
11 years
cluster: RHEL510 - Install man pages with mode 0644
by Jan Pokorný
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=334a6b9cb3c...
Commit: 334a6b9cb3cda250444c8d3192d3ab33e70ad923
Parent: d55fe105fd6c3dc5ceafb60e08880a5653440732
Author: Jan Pokorný <jpokorny(a)redhat.com>
AuthorDate: Wed Apr 17 17:04:58 2013 +0200
Committer: Jan Pokorný <jpokorny(a)redhat.com>
CommitterDate: Wed Apr 17 17:04:58 2013 +0200
Install man pages with mode 0644
Man pages were previously installed mode 0755. Install them mode 0644.
Resolves: rhbz#883816
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
---
ccs/man/Makefile | 6 +++---
cman/man/Makefile | 4 ++--
dlm/man/Makefile | 4 ++--
fence/man/Makefile | 2 +-
group/man/Makefile | 2 +-
5 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/ccs/man/Makefile b/ccs/man/Makefile
index e9b8150..eaf6e0b 100644
--- a/ccs/man/Makefile
+++ b/ccs/man/Makefile
@@ -19,9 +19,9 @@ install:
install -d ${mandir}/man5
install -d ${mandir}/man7
install -d ${mandir}/man8
- install cluster.conf.5 ${mandir}/man5
- install ccs.7 ${mandir}/man7
- install ccsd.8 ccs_test.8 ccs_tool.8 ${mandir}/man8
+ install -m 644 cluster.conf.5 ${mandir}/man5
+ install -m 644 ccs.7 ${mandir}/man7
+ install -m 644 ccsd.8 ccs_test.8 ccs_tool.8 ${mandir}/man8
uninstall:
${UNINSTALL} cluster.conf.5 ${mandir}/man5
diff --git a/cman/man/Makefile b/cman/man/Makefile
index 8c379c4..8159ca7 100644
--- a/cman/man/Makefile
+++ b/cman/man/Makefile
@@ -18,8 +18,8 @@ include ${top_srcdir}/make/defines.mk
install:
install -d ${mandir}/man5
install -d ${mandir}/man8
- install cman.5 qdisk.5 ${mandir}/man5
- install cman_tool.8 qdiskd.8 mkqdisk.8 ${mandir}/man8
+ install -m 644 cman.5 qdisk.5 ${mandir}/man5
+ install -m 644 cman_tool.8 qdiskd.8 mkqdisk.8 ${mandir}/man8
uninstall:
${UNINSTALL} cman.5 qdisk.5 ${mandir}/man5
diff --git a/dlm/man/Makefile b/dlm/man/Makefile
index 2e0b534..00cda0c 100644
--- a/dlm/man/Makefile
+++ b/dlm/man/Makefile
@@ -41,9 +41,9 @@ clean:
install:
install -d ${mandir}/man3
- install ${TARGET3} ${mandir}/man3
+ install -m 644 ${TARGET3} ${mandir}/man3
install -d ${mandir}/man8
- install ${TARGET8} ${mandir}/man8
+ install -m 644 ${TARGET8} ${mandir}/man8
uninstall:
${UNINSTALL} ${TARGET3} ${mandir}/man3
diff --git a/fence/man/Makefile b/fence/man/Makefile
index 3ccc8e6..96a9142 100644
--- a/fence/man/Makefile
+++ b/fence/man/Makefile
@@ -38,7 +38,7 @@ include ${top_srcdir}/make/defines.mk
install:
install -d ${mandir}/man8
- install ${TARGET8} ${mandir}/man8
+ install -m 644 ${TARGET8} ${mandir}/man8
uninstall:
${UNINSTALL} ${TARGET8} ${mandir}/man8
diff --git a/group/man/Makefile b/group/man/Makefile
index a5a36a4..9e218dd 100644
--- a/group/man/Makefile
+++ b/group/man/Makefile
@@ -24,7 +24,7 @@ include ${top_srcdir}/make/defines.mk
install:
install -d ${mandir}/man8
- install ${TARGET8} ${mandir}/man8
+ install -m 644 ${TARGET8} ${mandir}/man8
uninstall:
${UNINSTALL} ${TARGET8} ${mandir}/man8
11 years
gfs2-utils: master - gfs2_edit: Fix divide by zero bug
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=4d4c96cb...
Commit: 4d4c96cbb24a58b54a198e01044e7cce161ea323
Parent: 6649ab418b25992eb707ab821f2fdcb317c27dd9
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Apr 17 16:28:58 2013 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Wed Apr 17 16:28:58 2013 +0100
gfs2_edit: Fix divide by zero bug
gfs2_edit uses its own superblock reading functions instead of read_sb
so the sd_blocks_per_bitmap 'constant' doesn't get calculated causing a
divide-by-zero crash. With this patch, the value is now calculated in
compute_constants() which does get called by gfs2_edit.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/misc.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index 9efddcd..c05a770 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -70,6 +70,8 @@ int compute_constants(struct gfs2_sbd *sdp)
sdp->sd_hash_bsize = sdp->bsize / 2;
sdp->sd_hash_bsize_shift = sdp->sd_sb.sb_bsize_shift - 1;
sdp->sd_hash_ptrs = sdp->sd_hash_bsize / sizeof(uint64_t);
+ sdp->sd_blocks_per_bitmap = (sdp->sd_sb.sb_bsize - sizeof(struct gfs2_meta_header))
+ * GFS2_NBBY;
/* Compute maximum reservation required to add a entry to a directory */
11 years
cluster: RHEL510 - ccs_tool: fix several segfaults
by Jan Pokorný
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=d55fe105fd6...
Commit: d55fe105fd6c3dc5ceafb60e08880a5653440732
Parent: 07766f691733c71344a703eff31636fac3ca1d30
Author: Jan Pokorný <jpokorny(a)redhat.com>
AuthorDate: Wed Apr 17 15:21:54 2013 +0200
Committer: Jan Pokorný <jpokorny(a)redhat.com>
CommitterDate: Wed Apr 17 15:21:54 2013 +0200
ccs_tool: fix several segfaults
(1) input file = output file and subcommand gets some options
(2) update gets no input file
+ several overflows in case the output file was specified explicitly
and contained, as a global path, around 255 bytes or more
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
---
ccs/ccs_tool/ccs_tool.c | 2 +-
ccs/ccs_tool/update.c | 28 ++++++++++++++++++++--------
2 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/ccs/ccs_tool/ccs_tool.c b/ccs/ccs_tool/ccs_tool.c
index 5fcd667..bde7d30 100644
--- a/ccs/ccs_tool/ccs_tool.c
+++ b/ccs/ccs_tool/ccs_tool.c
@@ -12,7 +12,7 @@ static void print_usage(FILE *stream);
int main(int argc, char *argv[])
{
- optind = 1;
+ /* implicitly initialized by the library: optind = 1; */
if (argc < 2 || !strcmp(argv[optind], "-h")) {
print_usage(stdout);
diff --git a/ccs/ccs_tool/update.c b/ccs/ccs_tool/update.c
index 3af779b..c6f4362 100644
--- a/ccs/ccs_tool/update.c
+++ b/ccs/ccs_tool/update.c
@@ -15,6 +15,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <ctype.h>
+#include <getopt.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/xpath.h>
@@ -117,6 +118,7 @@ static int parse_args(int argc, char **argv, char **loc)
{
int c, error, ret;
+ optind = 1; /* reset the global for getopt from previous use */
while ((c = getopt(argc, argv, "P:")) != EOF) {
switch(c) {
case 'P':
@@ -191,19 +193,28 @@ int update2(int argc, char **argv)
struct timeval tv;
- if (parse_args(argc, argv, &location))
+ if (parse_args(argc, argv, &location) || !location) {
+ if (!location)
+ fprintf(stderr, "Source configuration file not specified.\n");
return -1;
+ }
if (location[0] != '/') {
- memset(true_location, 0, 256);
- if (!getcwd(true_location, 256)) {
+ if (!getcwd(true_location, sizeof(true_location))) {
fprintf(stderr, "Unable to get the current working directory.\n");
return -errno;
}
- true_location[strlen(true_location)] = '/';
- strncpy(true_location+strlen(true_location), location, 256-strlen(true_location));
+ i = (int) strlen(true_location);
+ if (i >= sizeof(true_location) - 2
+ || strlen(location) + i > sizeof(true_location) - 2) {
+ /* tl[254]='/', tl[255]=first char of location ... nul-termination? */
+ fprintf(stderr, "Overly nested location a/o a long relative path.\n");
+ return -1;
+ }
+ true_location[i] = '/';
+ strcpy(true_location + (i+1), location);
} else {
- strncpy(true_location, location, 256);
+ true_location[0] = '\0';
}
desc = ccs_connect();
@@ -232,10 +243,11 @@ int update2(int argc, char **argv)
v1 = atoi(v1_str);
free(v1_str);
- doc = xmlParseFile(true_location);
+ doc = xmlParseFile(true_location[0] ? true_location : location);
if (!doc) {
- fprintf(stderr, "Unable to parse %s\n", true_location);
+ fprintf(stderr, "Unable to parse %s\n",
+ true_location[0] ? true_location : location);
return -EINVAL;
}
11 years
fence-agents: master - fencing: Monitor/list is not working correctly
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=a503b8...
Commit: a503b8a48236b63ba156d773aa60a41561c8f082
Parent: 06f7d26340d8f700dc834e8ce5495bf156e20d2e
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Apr 17 10:24:20 2013 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Wed Apr 17 10:24:20 2013 +0200
fencing: Monitor/list is not working correctly
Bug was introduced with multiple plug support.
---
fence/agents/lib/fencing.py.py | 3 ++-
tests/test-apc5.py | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 1109be6..b14c329 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -785,7 +785,8 @@ def fence_action(tn, options, set_power_fn, get_power_fn, get_outlet_list = None
result = 0
try:
- options["--plugs"] = options["--plug"].split(",")
+ if options.has_key("--plug"):
+ options["--plugs"] = options["--plug"].split(",")
## Process options that manipulate fencing device
#####
diff --git a/tests/test-apc5.py b/tests/test-apc5.py
index 7e86a91..6cea3b1 100755
--- a/tests/test-apc5.py
+++ b/tests/test-apc5.py
@@ -9,8 +9,8 @@ def main():
ACT_ONOFF = "actions.d/power-on-off.cfg"
ACT_LIST = "actions.d/list.cfg"
- test_action(DEVICE, ACT_STATUS, "getopt")
- test_action(DEVICE, ACT_ONOFF, "stdin")
+ test_action(DEVICE, ACT_STATUS, "getopt", verbose=1)
+# test_action(DEVICE, ACT_ONOFF, "stdin")
test_action(DEVICE, ACT_LIST, "getopt")
if __name__ == "__main__":
11 years
cluster: RHEL510 - rgmanager: Update SAPInstance agent resource limits
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=07766f69173...
Commit: 07766f691733c71344a703eff31636fac3ca1d30
Parent: 8ebfc023495b1010e6802ab1be6fb11790f35494
Author: Chris Feist <cfeist(a)redhat.com>
AuthorDate: Fri Dec 7 13:37:57 2012 -0600
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Tue Apr 16 10:35:09 2013 -0400
rgmanager: Update SAPInstance agent resource limits
Update the rgmanager SAPInstance agent so resource limits configured in
/usr/sap/services are properly applied.
This is commit f6a961f28ba5dd321dd069c9b621f89a3481894e
from resource-agents.git
Resolves: rhbz#869705
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/resources/SAPInstance | 38 +++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/resources/SAPInstance b/rgmanager/src/resources/SAPInstance
index 802d3c0..fbfb7d7 100644
--- a/rgmanager/src/resources/SAPInstance
+++ b/rgmanager/src/resources/SAPInstance
@@ -162,6 +162,40 @@ sapinstance_methods() {
!
}
+#
+# setup_limits: If sapstartsrv needs to be started by this resource agent we need to ensure that any resource
+# limits configured in /usr/sap/sapservices are applied.
+# Since sapstartsrv is started as root and then it downgrades its privileges by calling setuid() and
+# setgid() any PAM limits at /etc/security/limits.conf are not applied.
+# Should sapstartsrv need to be started, we look for values configured at /usr/sap/sapservices (as
+# per SAP note 1437105) and, if found, we apply them before starting sapstartsrv.
+# Instance processes are started by sapstartsrv and will inherit resource limits from it.
+#
+setup_limits() {
+ if [ -r $SAPSERVICES ]
+ then
+ descriptors=`grep "^limit.descriptors" $SAPSERVICES | sed -e "s/limit.descriptors=//" `
+ if [ -n $descriptors ]
+ then
+ ocf_log info "found valid open file descriptors limit at ${SAPSERVICES}: ${descriptors}, applying..."
+ eval ulimit -n $descriptors
+ fi
+
+ stacksize=`grep "^limit.stacksize" $SAPSERVICES | sed -e "s/limit.stacksize=//" `
+ if [ -n $stacksize ]
+ then
+ ocf_log info "found valid stack size limit at ${SAPSERVICES}: ${stacksize}, applying..."
+ eval ulimit -s $stacksize
+ fi
+
+ datasize=`grep "^limit.datasize" $SAPSERVICES | sed -e "s/limit.datasize=//" `
+ if [ -n $datasize ]
+ then
+ ocf_log info "found valid process data segment size limit at ${SAPSERVICES}: ${datasize}, applying..."
+ eval ulimit -d $datasize
+ fi
+ fi
+}
#
# check_sapstartsrv : Before using sapcontrol we make sure that the sapstartsrv is running for the correct instance.
@@ -192,6 +226,8 @@ check_sapstartsrv() {
if [ $restart -eq 1 ]
then
pkill -9 -f "sapstartsrv.*$runninginst"
+
+ setup_limits
$SAPSTARTSRV pf=$SAPSTARTPROFILE -D -u $sidadm
# now make sure the daemon has been started and is able to respond
@@ -571,6 +607,8 @@ if [ `echo $LD_LIBRARY_PATH | grep -c "^$DIR_EXECUTABLE\>"` -eq 0 ]; then
fi
sidadm="`echo $SID | tr '[:upper:]' '[:lower:]'`adm"
+SAPSERVICES=/usr/sap/sapservices
+
# What kind of method was invoked?
case "$1" in
11 years
cluster: RHEL510 - fence_xvm: Add a delay (-w) option
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=8ebfc023495...
Commit: 8ebfc023495b1010e6802ab1be6fb11790f35494
Parent: adf106455d72219956030c7f821b0dd06381a9cb
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Mon Apr 15 10:13:56 2013 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Mon Apr 15 10:13:56 2013 -0400
fence_xvm: Add a delay (-w) option
Add a delay option to fence_xvm that causes it to sleep some specified
number of seconds before performing fencing operations.
Resolves: rhbz#854183
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
fence/agents/xvm/fence_xvm.c | 5 ++++-
fence/agents/xvm/options.c | 21 ++++++++++++++++++++-
fence/agents/xvm/options.h | 1 +
fence/man/fence_xvm.8 | 7 +++++++
4 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/fence/agents/xvm/fence_xvm.c b/fence/agents/xvm/fence_xvm.c
index eb006fd..0cb78e5 100644
--- a/fence/agents/xvm/fence_xvm.c
+++ b/fence/agents/xvm/fence_xvm.c
@@ -317,7 +317,7 @@ int
main(int argc, char **argv)
{
fence_xvm_args_t args;
- char *my_options = "di:a:p:r:C:c:k:H:uo:t:?hV";
+ char *my_options = "di:a:p:r:C:c:k:H:uo:t:?hVw:";
args_init(&args);
if (argc == 1) {
@@ -372,5 +372,8 @@ main(int argc, char **argv)
return 1;
}
+ if (args.delay > 0)
+ sleep(args.delay);
+
return fence_xen_domain(&args);
}
diff --git a/fence/agents/xvm/options.c b/fence/agents/xvm/options.c
index c77dee0..107b29a 100644
--- a/fence/agents/xvm/options.c
+++ b/fence/agents/xvm/options.c
@@ -251,6 +251,20 @@ assign_help(fence_xvm_args_t *args, struct arg_info *arg, char *value)
static inline void
+assign_delay(fence_xvm_args_t *args, struct arg_info *arg, char *value)
+{
+ if (!value)
+ return;
+
+ args->delay = atoi(value);
+ if (args->timeout <= 0) {
+ printf("Invalid delay: '%s'\n", value);
+ args->flags |= F_ERR;
+ }
+}
+
+
+static inline void
assign_version(fence_xvm_args_t *args, struct arg_info *arg, char *value)
{
args->flags |= F_VERSION;
@@ -369,7 +383,11 @@ static struct arg_info _arg_info[] = {
{ 'U', "-U", "uri",
"URI for Hypervisor (default: auto detect)",
assign_uri },
-
+
+ { 'w', "-w <delay>", "delay",
+ "Fencing delay (in seconds; default=0)",
+ assign_delay },
+
{ 'V', "-V", NULL,
"Display version and exit",
assign_version },
@@ -433,6 +451,7 @@ args_init(fence_xvm_args_t *args)
args->retr_time = 20;
args->flags = 0;
args->debug = 0;
+ args->delay = 0;
}
diff --git a/fence/agents/xvm/options.h b/fence/agents/xvm/options.h
index 7687acc..9115b09 100644
--- a/fence/agents/xvm/options.h
+++ b/fence/agents/xvm/options.h
@@ -44,6 +44,7 @@ typedef struct {
unsigned int ifindex;
int family;
int timeout;
+ int delay;
int retr_time;
arg_flags_t flags;
int debug;
diff --git a/fence/man/fence_xvm.8 b/fence/man/fence_xvm.8
index 55c7915..209761e 100644
--- a/fence/man/fence_xvm.8
+++ b/fence/man/fence_xvm.8
@@ -87,6 +87,10 @@ failure!).
This specifies the amount of time, in seconds, to wait before a response to
the multicast request before giving up (default=30).
.TP
+\fB-w\fP \fIdelay\fP
+.
+Fencing delay (in seconds). The fence agent will wait the specified number of seconds before attempting a fencing operation. (Default Value: 0)
+.TP
\fB-?\fP
Print out a help message describing available options, then exit.
.TP
@@ -137,6 +141,9 @@ Same as the -o option.
\fItimeout = < param >\fR
Same as the -t option.
.TP
+\fIdelay = < param >\fR
+Same as the -w option.
+.TP
\fIdomain = < param >\fR
Same as the -H option.
11 years
cluster: RHEL510 - rgmanager: Clean up comments in ASEHAagent.sh
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=adf106455d7...
Commit: adf106455d72219956030c7f821b0dd06381a9cb
Parent: a5875267a2eb0137dc7a123340db44d42dee4ee9
Author: J.H.M. Dassen (Ray) <rdassen(a)redhat.com>
AuthorDate: Tue Feb 5 09:54:15 2013 +0100
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Fri Apr 12 14:13:52 2013 -0400
rgmanager: Clean up comments in ASEHAagent.sh
Grammar fix
Resolves: rhbz#841142
Acked-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/resources/ASEHAagent.sh | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/rgmanager/src/resources/ASEHAagent.sh b/rgmanager/src/resources/ASEHAagent.sh
index 489d49b..38a78b6 100755
--- a/rgmanager/src/resources/ASEHAagent.sh
+++ b/rgmanager/src/resources/ASEHAagent.sh
@@ -528,11 +528,11 @@ EOF
sleep 5
- # Check if the server has been shutted down successfully
+ # Check if the server has been shut down successfully
t=0
while [[ $t -lt $OCF_RESKEY_shutdown_timeout ]]
do
- # Search "ueshutdown: exiting" in the server log. If found, it means the server has been shutted down.
+ # Search "ueshutdown: exiting" in the server log. If found, it means the server has been shut down.
# Otherwise, we need to wait.
tail $CONSOLE_LOG | grep "ueshutdown: exiting" > /dev/null 2>&1
if [[ $? != 0 ]]
@@ -547,14 +547,14 @@ EOF
fi
done
- # If $t is larger than shutdown_timeout, it means the ASE server cannot be shutted down in given time. We need
+ # If $t is larger than shutdown_timeout, it means the ASE server cannot be shut down in given time. We need
# to wait for the background kill process to kill the OS processes directly.
if [[ $t -ge $OCF_RESKEY_shutdown_timeout ]]
then
ocf_log err "ASEHAagent: Shutdown of '$OCF_RESKEY_server_name' from isql failed. Server is either down or unreachable."
fi
- # Here, the ASE server has been shutted down by isql command or killed by background process. We need to do
+ # Here, the ASE server has been shut down by isql command or killed by background process. We need to do
# further check to make sure all processes have gone away before saying shutdown is complete. This stops the
# other node from starting up the package before it has been stopped and the file system has been unmounted.
11 years