commit 5fb3efb518b2be4e7f3cd141e1643cb449b8a9c5 Author: Christine Caulfield <ccaulfie@redhat.com> Date: Tue Jul 28 08:46:36 2009 +0100 cman: make cman_tool leave remove work even when no services are running. cman_tool leave takes a shortcut internally if no services are listening for shutdown events. Unfortunately, a bug in this shortcut means that the leave flags gets lost, so quorum is not adjusted downwards. This patch fixes that shortcut. I should make it clear that 'leave remove' works fine if any cluster services are running. Signed-off-by: Christine Caulfield <ccaulfie@redhat.com> diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c index 402efbb..29a9f1f 100644 --- a/cman/daemon/commands.c +++ b/cman/daemon/commands.c @@ -948,6 +948,13 @@ static int do_cmd_try_shutdown(struct connection *con, char *cmdbuf) /* If no-one is listening for events then we can just go down now */ if (shutdown_expected == 0) { send_leave(CLUSTER_LEAVEFLAG_DOWN); + int leaveflags = CLUSTER_LEAVEFLAG_DOWN; + + quit_threads = 1; + if (shutdown_flags & SHUTDOWN_REMOVE) + leaveflags |= CLUSTER_LEAVEFLAG_REMOVED; + + send_leave(leaveflags); return 0; } else {