cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Lon Hohberger <lhh@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] rgmanager: OCF_NOT_INSTALLED is OK if we stop when stopped (RHEL5)
Date: Wed,  4 Jan 2012 16:01:44 -0500	[thread overview]
Message-ID: <1325710904-30372-1-git-send-email-lhh@redhat.com> (raw)

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.

Resolves: rhbz#768146

Signed-off-by: Lon Hohberger <lhh@redhat.com>
Reviewed-by: Adam Drew <adrew@redhat.com>
Tested-by: Adam Drew <adrew@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 697c7b1..367fbb3 100644
--- a/rgmanager/src/daemons/restree.c
+++ b/rgmanager/src/daemons/restree.c
@@ -519,6 +519,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) ||
@@ -1523,7 +1527,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;
 		}
-- 
1.7.3.4



             reply	other threads:[~2012-01-04 21:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-04 21:01 Lon Hohberger [this message]
2012-01-04 21:02 ` [Cluster-devel] [PATCH] rgmanager: OCF_NOT_INSTALLED is OK if we stop when stopped (RHEL5) Lon Hohberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1325710904-30372-1-git-send-email-lhh@redhat.com \
    --to=lhh@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).