From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christine Caulfield Date: Fri, 30 Mar 2012 09:18:40 +0100 Subject: [Cluster-devel] [PATCH 2/2] cman init: fix start sequence error handling In-Reply-To: <1333094829-4833-2-git-send-email-fdinitto@redhat.com> References: <1333094829-4833-1-git-send-email-fdinitto@redhat.com> <1333094829-4833-2-git-send-email-fdinitto@redhat.com> Message-ID: <4F756C60.4040009@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ACK Reviewed-by: Christine Caulfield On 30/03/12 09:07, Fabio M. Di Nitto wrote: > From: "Fabio M. Di Nitto" > > 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 > --- > 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