FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 03-30-2012, 08:18 AM
Christine Caulfield
 
Default cman init: fix start sequence error handling

ACK

Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>

On 30/03/12 09:07, Fabio M. Di Nitto wrote:

From: "Fabio M. Di Nitto"<fdinitto@redhat.com>

Any daemon that fails to start would leave no traces.

the problem with cman init is that we need to handle multiple daemons
and tools. If one in the chain fails, we never reverted to the original
state of the system. This can indeed cause other issues.

Fix the init script to "stop" cman if any error happens during "start.

Resolves: rhbz#806002

Signed-off-by: Fabio M. Di Nitto<fdinitto@redhat.com>
---
cman/init.d/cman.in | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index d0c6f70..a39f19f 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -19,6 +19,9 @@
# set secure PATH
PATH="/bin:/usr/bin:/sbin:/usr/sbin:@SBINDIR@"

+# save invokation for rollback ops
+thisinvokation="$0"
+
chkconfig2()
{
case "$1" in
@@ -199,6 +202,9 @@ nok() {
echo -e "$errmsg"
failure
echo
+ if [ "$currentaction" = "start" ]; then
+ $thisinvokation stop
+ fi
exit 1
}

@@ -744,6 +750,7 @@ leave_fence_domain()

start()
{
+ currentaction="start"
breakpoint="$1"

sshd_enabled&& cd @INITDDIR@&& ./sshd start
 

Thread Tools




All times are GMT. The time now is 07:39 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org