resource-agents: master - resource-agents: More misc. vm.sh warnings
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git...
Commit: 655c17612390283deed576751f0dfea04603e4c1
Parent: becbaff82799a2327f696231f614ca1c4c6be1a0
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Fri Oct 30 17:23:03 2009 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Tue Nov 3 12:14:51 2009 -0500
resource-agents: More misc. vm.sh warnings
This adds:
- warnings if use_virsh="1" is set while path is also set
- warnings if you are not root
- checks for xm and virsh binaries in $PATH
Resolves: rhbz#529926
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/vm.sh | 25 +++++++++++++++++++++++--
1 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh
index fd62747..4f2d0d8 100644
--- a/rgmanager/src/resources/vm.sh
+++ b/rgmanager/src/resources/vm.sh
@@ -565,7 +565,10 @@ do_status()
validate_all()
{
- [ "$(id -u)" = "0" ] || return 1
+ if [ "$(id -u)" != "0" ]; then
+ ocf_log err "Cannot control VMs. as non-root user."
+ return 1
+ fi
#
# If someone selects a hypervisor, honor it.
@@ -600,22 +603,40 @@ validate_all()
echo "Management tool: virsh"
export OCF_RESKEY_use_virsh=1
else
+ if [ -n "$OCF_RESKEY_use_virsh" ]; then
+ ocf_log warning "Cannot use virsh with 'path' attribute set"
+ ocf_log warning "Setting use_virsh to 0."
+ fi
+
if [ "$OCF_RESKEY_hypervisor" != "xen" ]; then
ocf_log err "Cannot use $OCF_RESKEY_hypervisor hypervisor with 'path' attribute"
return $OCF_ERR_ARGS
fi
-
+
echo "Management tool: xm"
export OCF_RESKEY_use_virsh=0
fi
fi
if [ "$OCF_RESKEY_use_virsh" = "0" ]; then
+
+ which xm &> /dev/null
+ if [ $? -ne 0 ]; then
+ ocf_log err "Cannot find 'xm'; is it installed?"
+ return $OCF_ERR_INSTALLED
+ fi
+
if [ "$OCF_RESKEY_hypervisor" = "qemu" ] ||
[ "$OCF_RESKEY_hypervisor" = "kvm" ]; then
ocf_log err "Cannot use $OCF_RESKEY_hypervisor hypervisor without using virsh"
return $OCF_ERR_ARGS
fi
+ else
+ which virsh &> /dev/null
+ if [ $? -ne 0 ]; then
+ ocf_log err "Cannot find 'virsh'; is it installed?"
+ return $OCF_ERR_INSTALLED
+ fi
fi
#
14 years, 6 months
resource-agents: master - resource-agents: Report bad config from vm.sh
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git...
Commit: becbaff82799a2327f696231f614ca1c4c6be1a0
Parent: bf230b3eb1cc4576a001ce173704c398a3f3cef6
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Fri Oct 30 17:23:03 2009 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Tue Nov 3 12:14:24 2009 -0500
resource-agents: Report bad config from vm.sh
Resolves: rhbz#529926
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/vm.sh | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh
index 4113a50..fd62747 100644
--- a/rgmanager/src/resources/vm.sh
+++ b/rgmanager/src/resources/vm.sh
@@ -600,11 +600,24 @@ validate_all()
echo "Management tool: virsh"
export OCF_RESKEY_use_virsh=1
else
+ if [ "$OCF_RESKEY_hypervisor" != "xen" ]; then
+ ocf_log err "Cannot use $OCF_RESKEY_hypervisor hypervisor with 'path' attribute"
+ return $OCF_ERR_ARGS
+ fi
+
echo "Management tool: xm"
export OCF_RESKEY_use_virsh=0
fi
fi
+ if [ "$OCF_RESKEY_use_virsh" = "0" ]; then
+ if [ "$OCF_RESKEY_hypervisor" = "qemu" ] ||
+ [ "$OCF_RESKEY_hypervisor" = "kvm" ]; then
+ ocf_log err "Cannot use $OCF_RESKEY_hypervisor hypervisor without using virsh"
+ return $OCF_ERR_ARGS
+ fi
+ fi
+
#
# Set the hypervisor URI
#
14 years, 6 months
cluster: STABLE3 - resource-agents: More misc. vm.sh warnings
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 5e62d76ae6b653e89036a96247d317b98ef03fc9
Parent: a51413ed9a3328db822482306ac0c0f9f494c57e
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Fri Oct 30 17:23:03 2009 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Tue Nov 3 12:12:52 2009 -0500
resource-agents: More misc. vm.sh warnings
This adds:
- warnings if use_virsh="1" is set while path is also set
- warnings if you are not root
- checks for xm and virsh binaries in $PATH
Resolves: rhbz#529926
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/vm.sh | 25 +++++++++++++++++++++++--
1 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh
index fd62747..4f2d0d8 100644
--- a/rgmanager/src/resources/vm.sh
+++ b/rgmanager/src/resources/vm.sh
@@ -565,7 +565,10 @@ do_status()
validate_all()
{
- [ "$(id -u)" = "0" ] || return 1
+ if [ "$(id -u)" != "0" ]; then
+ ocf_log err "Cannot control VMs. as non-root user."
+ return 1
+ fi
#
# If someone selects a hypervisor, honor it.
@@ -600,22 +603,40 @@ validate_all()
echo "Management tool: virsh"
export OCF_RESKEY_use_virsh=1
else
+ if [ -n "$OCF_RESKEY_use_virsh" ]; then
+ ocf_log warning "Cannot use virsh with 'path' attribute set"
+ ocf_log warning "Setting use_virsh to 0."
+ fi
+
if [ "$OCF_RESKEY_hypervisor" != "xen" ]; then
ocf_log err "Cannot use $OCF_RESKEY_hypervisor hypervisor with 'path' attribute"
return $OCF_ERR_ARGS
fi
-
+
echo "Management tool: xm"
export OCF_RESKEY_use_virsh=0
fi
fi
if [ "$OCF_RESKEY_use_virsh" = "0" ]; then
+
+ which xm &> /dev/null
+ if [ $? -ne 0 ]; then
+ ocf_log err "Cannot find 'xm'; is it installed?"
+ return $OCF_ERR_INSTALLED
+ fi
+
if [ "$OCF_RESKEY_hypervisor" = "qemu" ] ||
[ "$OCF_RESKEY_hypervisor" = "kvm" ]; then
ocf_log err "Cannot use $OCF_RESKEY_hypervisor hypervisor without using virsh"
return $OCF_ERR_ARGS
fi
+ else
+ which virsh &> /dev/null
+ if [ $? -ne 0 ]; then
+ ocf_log err "Cannot find 'virsh'; is it installed?"
+ return $OCF_ERR_INSTALLED
+ fi
fi
#
14 years, 6 months
cluster: STABLE3 - resource-agents: Report bad config from vm.sh
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: a51413ed9a3328db822482306ac0c0f9f494c57e
Parent: c9fd975df0a36f18ef0dc6d46e4621d28a5d1d94
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Fri Oct 30 17:23:03 2009 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Tue Nov 3 12:12:32 2009 -0500
resource-agents: Report bad config from vm.sh
Resolves: rhbz#529926
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/vm.sh | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh
index 4113a50..fd62747 100644
--- a/rgmanager/src/resources/vm.sh
+++ b/rgmanager/src/resources/vm.sh
@@ -600,11 +600,24 @@ validate_all()
echo "Management tool: virsh"
export OCF_RESKEY_use_virsh=1
else
+ if [ "$OCF_RESKEY_hypervisor" != "xen" ]; then
+ ocf_log err "Cannot use $OCF_RESKEY_hypervisor hypervisor with 'path' attribute"
+ return $OCF_ERR_ARGS
+ fi
+
echo "Management tool: xm"
export OCF_RESKEY_use_virsh=0
fi
fi
+ if [ "$OCF_RESKEY_use_virsh" = "0" ]; then
+ if [ "$OCF_RESKEY_hypervisor" = "qemu" ] ||
+ [ "$OCF_RESKEY_hypervisor" = "kvm" ]; then
+ ocf_log err "Cannot use $OCF_RESKEY_hypervisor hypervisor without using virsh"
+ return $OCF_ERR_ARGS
+ fi
+ fi
+
#
# Set the hypervisor URI
#
14 years, 6 months
cluster: RHEL55 - resource-agents: More misc. vm.sh warnings
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: a52ad31c2140655e327c27caa0fef8d23adb3bef
Parent: da220abc1de33c59cef58f23433d434ceab3638f
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Fri Oct 30 17:23:03 2009 -0400
Committer: root <root(a)localhost.localdomain>
CommitterDate: Tue Nov 3 09:53:38 2009 -0500
resource-agents: More misc. vm.sh warnings
This adds:
- warnings if use_virsh="1" is set while path is also set
- warnings if you are not root
- checks for xm and virsh binaries in $PATH
Resolves: rhbz#529926
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/vm.sh | 25 +++++++++++++++++++++++--
1 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh
index 02bb5ff..8169ae4 100755
--- a/rgmanager/src/resources/vm.sh
+++ b/rgmanager/src/resources/vm.sh
@@ -550,7 +550,10 @@ do_status()
validate_all()
{
- [ "$(id -u)" = "0" ] || return 1
+ if [ "$(id -u)" != "0" ]; then
+ ocf_log err "Cannot control VMs. as non-root user."
+ return 1
+ fi
#
# If someone selects a hypervisor, honor it.
@@ -585,22 +588,40 @@ validate_all()
echo "Management tool: virsh"
export OCF_RESKEY_use_virsh=1
else
+ if [ -n "$OCF_RESKEY_use_virsh" ]; then
+ ocf_log warning "Cannot use virsh with 'path' attribute set"
+ ocf_log warning "Setting use_virsh to 0."
+ fi
+
if [ "$OCF_RESKEY_hypervisor" != "xen" ]; then
ocf_log err "Cannot use $OCF_RESKEY_hypervisor hypervisor with 'path' attribute"
return $OCF_ERR_ARGS
fi
-
+
echo "Management tool: xm"
export OCF_RESKEY_use_virsh=0
fi
fi
if [ "$OCF_RESKEY_use_virsh" = "0" ]; then
+
+ which xm &> /dev/null
+ if [ $? -ne 0 ]; then
+ ocf_log err "Cannot find 'xm'; is it installed?"
+ return $OCF_ERR_INSTALLED
+ fi
+
if [ "$OCF_RESKEY_hypervisor" = "qemu" ] ||
[ "$OCF_RESKEY_hypervisor" = "kvm" ]; then
ocf_log err "Cannot use $OCF_RESKEY_hypervisor hypervisor without using virsh"
return $OCF_ERR_ARGS
fi
+ else
+ which virsh &> /dev/null
+ if [ $? -ne 0 ]; then
+ ocf_log err "Cannot find 'virsh'; is it installed?"
+ return $OCF_ERR_INSTALLED
+ fi
fi
#
14 years, 6 months
cluster: STABLE3 - build: use xvm build fix from Debian
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: c9fd975df0a36f18ef0dc6d46e4621d28a5d1d94
Parent: 8000c70a8d28a2e79305babd8b869b73605a3349
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue Nov 3 10:32:15 2009 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue Nov 3 10:32:15 2009 +0100
build: use xvm build fix from Debian
this is cleaner and requires less maintainance.
Thanks Guido for the heads up.
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
fence/agents/xvm/Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fence/agents/xvm/Makefile b/fence/agents/xvm/Makefile
index 443a39a..31b277f 100644
--- a/fence/agents/xvm/Makefile
+++ b/fence/agents/xvm/Makefile
@@ -61,7 +61,7 @@ ${TARGET3}: ${OBJS3}
$(MANTARGET): $(TARGET1) ${SRCDIR}/fence/agents/lib/fence2man.xsl
set -e && \
- LD_PRELOAD=${logtlibdir}/liblogthread.so.$(SOMAJOR) ./$(TARGET1) -o metadata > .$@.tmp && \
+ LD_LIBRARY_PATH=${logtlibdir} ./$(TARGET1) -o metadata > .$@.tmp && \
xsltproc ${SRCDIR}/fence/agents/lib/fence2man.xsl .$@.tmp > $@
clean: generalclean
14 years, 6 months
cluster: master - qdiskd: Make qdiskd stop crying wolf
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: eb8ec0b6d1a38f12a03e52183595c31b96b75d85
Parent: 81d3d6a20cf95bb3da64b66fe56ac52ae521d6ae
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Mon Nov 2 17:30:38 2009 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Mon Nov 2 17:33:32 2009 -0500
qdiskd: Make qdiskd stop crying wolf
The I/O hang check timer in qdiskd was somehow being woken
up twice on rare occasion, causing qdiskd to falsely
report an I/O hang when there were no actual problems
with the system.
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
cman/qdisk/iostate.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/cman/qdisk/iostate.c b/cman/qdisk/iostate.c
index 4c67b8f..3d861ec 100644
--- a/cman/qdisk/iostate.c
+++ b/cman/qdisk/iostate.c
@@ -51,11 +51,12 @@ io_state(iostate_t state)
pthread_mutex_lock(&state_mutex);
main_state = state;
main_incarnation++; /* it does not matter if this wraps. */
- pthread_mutex_unlock(&state_mutex);
/* Optimization: Don't signal on STATE_NONE */
if (state != STATE_NONE)
pthread_cond_broadcast(&state_cond);
+
+ pthread_mutex_unlock(&state_mutex);
}
14 years, 6 months
cluster: STABLE3 - qdiskd: Make qdiskd stop crying wolf
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 8000c70a8d28a2e79305babd8b869b73605a3349
Parent: 81d24b6bdd33e8f16c39414f8bb8485baf19a919
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Mon Nov 2 17:30:38 2009 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Mon Nov 2 17:30:38 2009 -0500
qdiskd: Make qdiskd stop crying wolf
The I/O hang check timer in qdiskd was somehow being woken
up twice on rare occasion, causing qdiskd to falsely
report an I/O hang when there were no actual problems
with the system.
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
cman/qdisk/iostate.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/cman/qdisk/iostate.c b/cman/qdisk/iostate.c
index f195c45..0199da4 100644
--- a/cman/qdisk/iostate.c
+++ b/cman/qdisk/iostate.c
@@ -49,11 +49,12 @@ io_state(iostate_t state)
pthread_mutex_lock(&state_mutex);
main_state = state;
main_incarnation++; /* it does not matter if this wraps. */
- pthread_mutex_unlock(&state_mutex);
/* Optimization: Don't signal on STATE_NONE */
if (state != STATE_NONE)
pthread_cond_broadcast(&state_cond);
+
+ pthread_mutex_unlock(&state_mutex);
}
14 years, 6 months
cluster: STABLE3 - build: fix fence_xvm invokation at man page build time
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 81d24b6bdd33e8f16c39414f8bb8485baf19a919
Parent: 4bd7ebb83bb8dddb6907a20a84ee7d5dd3b31c9c
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Nov 2 14:36:06 2009 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Nov 2 14:36:06 2009 +0100
build: fix fence_xvm invokation at man page build time
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
fence/agents/xvm/Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fence/agents/xvm/Makefile b/fence/agents/xvm/Makefile
index 6215263..443a39a 100644
--- a/fence/agents/xvm/Makefile
+++ b/fence/agents/xvm/Makefile
@@ -61,7 +61,7 @@ ${TARGET3}: ${OBJS3}
$(MANTARGET): $(TARGET1) ${SRCDIR}/fence/agents/lib/fence2man.xsl
set -e && \
- ./$(TARGET1) -o metadata > .$@.tmp && \
+ LD_PRELOAD=${logtlibdir}/liblogthread.so.$(SOMAJOR) ./$(TARGET1) -o metadata > .$@.tmp && \
xsltproc ${SRCDIR}/fence/agents/lib/fence2man.xsl .$@.tmp > $@
clean: generalclean
14 years, 6 months