Send Linux-ha-cvs mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."
Today's Topics:
1. Linux-HA CVS: lib by andrew from
([email protected])
2. Linux-HA CVS: crm by andrew from
([email protected])
3. Linux-HA CVS: crm by andrew from
([email protected])
4. Linux-HA CVS: crm by andrew from
([email protected])
5. Linux-HA CVS: crm by andrew from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Tue, 14 Feb 2006 04:43:00 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : lib
Dir : linux-ha/lib/crm/transition
Added Files:
.cvsignore
Log Message:
Missing files
------------------------------
Message: 2
Date: Tue, 14 Feb 2006 04:43:00 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : crm
Dir : linux-ha/crm/tengine
Added Files:
events.c te_callbacks.h
Log Message:
Missing files
------------------------------
Message: 3
Date: Tue, 14 Feb 2006 04:52:26 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : crm
Dir : linux-ha/crm/crmd
Modified Files:
ccm.c
Log Message:
Fix for Bugzilla 1086: Take crmd peer status into account when updating the CIB.
During the join process, a node was in the CCM but did not have crmd running
yet. This caused faulty data to be sent to the CIB.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/ccm.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -3 -r1.94 -r1.95
--- ccm.c 3 Feb 2006 08:29:22 -0000 1.94
+++ ccm.c 14 Feb 2006 11:52:26 -0000 1.95
@@ -1,4 +1,4 @@
-/* $Id: ccm.c,v 1.94 2006/02/03 08:29:22 andrew Exp $ */
+/* $Id: ccm.c,v 1.95 2006/02/14 11:52:26 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -25,6 +25,8 @@
#include <clplumbing/GSource.h>
#include <string.h>
+#include <heartbeat.h>
+
#include <crm/crm.h>
#include <crm/cib.h>
#include <crm/msg_xml.h>
@@ -576,7 +578,7 @@
{
crm_data_t *updates;
const char *state;
- const char *join;
+ gboolean overwrite_join;
};
crm_data_t*
@@ -617,11 +619,11 @@
update_data.updates = tmp;
update_data.state = XML_BOOLEAN_YES;
- update_data.join = NULL;
+ update_data.overwrite_join = FALSE;
if(overwrite) {
crm_debug_2("Performing a join update based on CCM data");
- update_data.join = CRMD_JOINSTATE_PENDING;
+ update_data.overwrite_join = TRUE;
} else {
call_options = call_options|cib_inhibit_bcast;
@@ -637,7 +639,6 @@
/* dead nodes */
update_data.state = XML_BOOLEAN_NO;
- update_data.join = CRMD_STATE_INACTIVE;
if(fsa_membership_copy->dead_members != NULL) {
g_hash_table_foreach(fsa_membership_copy->dead_members,
ghash_update_cib_node, &update_data);
@@ -656,14 +657,27 @@
ghash_update_cib_node(gpointer key, gpointer value, gpointer user_data)
{
crm_data_t *tmp1 = NULL;
+ const char *join = NULL;
+ const char *peer_online = NULL;
const char *node_uname = (const char*)key;
struct update_data_s* data = (struct update_data_s*)user_data;
- crm_debug_2("Updating %s: %s/%s",
- node_uname, data->state, data->join);
-
+ crm_debug_2("Updating %s: %s (overwrite=%s)",
+ node_uname, data->state,
+ data->overwrite_join?"true":"false");
+
+ peer_online = g_hash_table_lookup(crmd_peer_state, node_uname);
+
+ if(data->overwrite_join) {
+ if(safe_str_eq(peer_online, ONLINESTATUS)) {
+ join = CRMD_JOINSTATE_PENDING;
+ } else {
+ join = CRMD_STATE_INACTIVE;
+ }
+ }
+
tmp1 = create_node_state(node_uname, NULL, data->state, NULL,
- data->join, NULL, FALSE, __FUNCTION__);
+ join, NULL, FALSE, __FUNCTION__);
add_node_copy(data->updates, tmp1);
free_xml(tmp1);
------------------------------
Message: 4
Date: Tue, 14 Feb 2006 04:53:48 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : crm
Dir : linux-ha/crm/crmd
Modified Files:
cib.c
Log Message:
Put our CIB into slave mode on exit
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/cib.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -3 -r1.45 -r1.46
--- cib.c 3 Feb 2006 08:29:22 -0000 1.45
+++ cib.c 14 Feb 2006 11:53:48 -0000 1.46
@@ -141,6 +141,8 @@
clear_bit_inplace(fsa_input_register, R_CIB_CONNECTED);
if(fsa_cib_conn != NULL
&& fsa_cib_conn->state != cib_disconnected) {
+ fsa_cib_conn->cmds->set_slave(
+ fsa_cib_conn, cib_scope_local);
fsa_cib_conn->cmds->signoff(fsa_cib_conn);
}
}
------------------------------
Message: 5
Date: Tue, 14 Feb 2006 04:55:08 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : crm
Dir : linux-ha/crm/crmd
Modified Files:
callbacks.c control.c crmd_fsa.h fsa.c fsa_defines.h
fsa_matrix.h lrm.c messages.c subsystems.c utils.c
Log Message:
Revamp the shutdown code
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/callbacks.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -3 -r1.100 -r1.101
--- callbacks.c 17 Jan 2006 21:47:28 -0000 1.100
+++ callbacks.c 14 Feb 2006 11:55:07 -0000 1.101
@@ -57,18 +57,18 @@
crmd_ha_msg_dispatch(IPC_Channel *channel, gpointer user_data)
{
gboolean stay_connected = TRUE;
- ll_cluster_t *hb_cluster = (ll_cluster_t*)user_data;
crm_debug_3("Invoked");
- if(IPC_ISRCONN(channel)) {
- if(hb_cluster->llc_ops->msgready(hb_cluster) == 0) {
+
+ if(fsa_cluster_conn != NULL && IPC_ISRCONN(channel)) {
+ if(fsa_cluster_conn->llc_ops->msgready(fsa_cluster_conn) == 0) {
crm_debug_2("no message ready yet");
}
/* invoke the callbacks but dont block */
- hb_cluster->llc_ops->rcvmsg(hb_cluster, 0);
+ fsa_cluster_conn->llc_ops->rcvmsg(fsa_cluster_conn, 0);
}
- if (channel->ch_status != IPC_CONNECT) {
+ if (fsa_cluster_conn == NULL || channel->ch_status != IPC_CONNECT) {
if(is_set(fsa_input_register, R_HA_DISCONNECTED) == FALSE) {
crm_crit("Lost connection to heartbeat service.");
} else {
@@ -207,6 +207,7 @@
crmd_ipc_msg_callback(IPC_Channel *client, gpointer user_data)
{
int lpc = 0;
+ int rc = IPC_OK;
IPC_Message *msg = NULL;
ha_msg_input_t *new_input = NULL;
crmd_client_t *curr_client = (crmd_client_t*)user_data;
@@ -219,15 +220,16 @@
if(client->ops->is_message_pending(client) == 0) {
break;
- } else if (client->ops->recv(client, &msg) != IPC_OK) {
- perror("Receive failure:");
- crm_err("[%s] [receive failure]",
- curr_client->table_key);
+ }
+ rc = client->ops->recv(client, &msg);
+ if (rc != IPC_OK) {
+ cl_perror("Receive failure from %s: %d",
+ curr_client->table_key, rc);
stay_connected = FALSE;
break;
} else if (msg == NULL) {
- crm_err("[%s] [no message this time]",
+ crm_err("%s: no message this time",
curr_client->table_key);
continue;
}
@@ -237,7 +239,7 @@
msg->msg_done(msg);
crm_debug_2("Processing msg from %s", curr_client->table_key);
- crm_log_message_adv(LOG_MSG, "CRMd[inbound]", new_input->msg);
+ crm_log_message_adv(LOG_DEBUG_2, "CRMd[inbound]",
new_input->msg);
if(crmd_authorize_message(new_input, curr_client)) {
register_fsa_input(C_IPC_MESSAGE, I_ROUTER, new_input);
}
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/control.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -3 -r1.112 -r1.113
--- control.c 10 Feb 2006 05:41:20 -0000 1.112
+++ control.c 14 Feb 2006 11:55:07 -0000 1.113
@@ -61,6 +61,7 @@
set_bit_inplace(fsa_input_register, R_HA_DISCONNECTED);
fsa_cluster_conn->llc_ops->signoff(
fsa_cluster_conn, FALSE);
+ fsa_cluster_conn->llc_ops->delete(fsa_cluster_conn);
fsa_cluster_conn = NULL;
}
crm_info("Disconnected from Heartbeat");
@@ -102,42 +103,39 @@
enum crmd_fsa_input current_input,
fsa_data_t *msg_data)
{
- enum crmd_fsa_input next_input = I_NULL;
- enum crmd_fsa_input tmp = I_NULL;
+ int lpc = 0;
+ gboolean continue_shutdown = TRUE;
+ struct crm_subsystem_s *subsystems[] = {
+ pe_subsystem,
+ te_subsystem
+ };
/* just in case */
set_bit_inplace(fsa_input_register, R_SHUTDOWN);
-
- /* last attempt to shut these down */
- if(is_set(fsa_input_register, R_PE_CONNECTED)) {
- tmp = do_pe_control(A_PE_STOP, cause, cur_state,
- current_input, msg_data);
- if(tmp != I_NULL) {
- next_input = I_ERROR;
- crm_err("Failed to shutdown the PolicyEngine");
- }
- }
- if(is_set(fsa_input_register, R_TE_CONNECTED)) {
- tmp = do_pe_control(A_TE_STOP, cause, cur_state,
- current_input, msg_data);
- if(tmp != I_NULL) {
- next_input = I_ERROR;
- crm_err("Failed to shutdown the Transitioner");
+ for(lpc = 0; lpc < DIMOF(subsystems); lpc++) {
+ struct crm_subsystem_s *a_subsystem = subsystems[lpc];
+ if(is_set(fsa_input_register, a_subsystem->flag_connected)) {
+ crm_info("Terminating the %s", a_subsystem->name);
+ if(stop_subsystem(a_subsystem, TRUE) == FALSE) {
+ /* its gone... */
+ crm_err("Faking %s exit", a_subsystem->name);
+ clear_bit_inplace(fsa_input_register,
+ a_subsystem->flag_connected);
+ }
+ continue_shutdown = FALSE;
}
}
- crm_debug_2("Stopping all remaining local resources");
- if(is_set(fsa_input_register, R_LRM_CONNECTED)) {
- stop_all_resources();
+ if(continue_shutdown == FALSE) {
+ crm_info("Waiting for subsystems to exit");
+ crmd_fsa_stall(NULL);
} else {
- crm_err("Exiting with no LRM connection..."
- " resources may be active!");
register_fsa_input(C_FSA_INTERNAL, I_TERMINATE, NULL);
}
- return next_input;
+ return I_NULL;
}
/* A_SHUTDOWN_REQ */
@@ -183,65 +181,30 @@
fsa_data_t *msg_data)
{
int exit_code = 0;
- gboolean do_exit = TRUE;
+ int log_level = LOG_INFO;
+ const char *exit_type = "gracefully";
- if(action & A_EXIT_0) {
- if(is_set(fsa_input_register, R_PE_CONNECTED)) {
- crm_info("Terminating the PEngine");
- if(stop_subsystem(pe_subsystem, TRUE) == FALSE) {
- /* its gone... */
- crm_warn("Faking PEngine exit");
- clear_bit_inplace(
- fsa_input_register, R_PE_CONNECTED);
- }
- crm_info("Waiting for the PE to disconnect");
- do_exit = FALSE;
-
- } else if(is_set(fsa_input_register, R_TE_CONNECTED)) {
- crm_info("Terminating the TEngine");
- if(stop_subsystem(te_subsystem, TRUE) == FALSE) {
- /* its gone... */
- crm_warn("Faking TEngine exit");
- clear_bit_inplace(
- fsa_input_register, R_TE_CONNECTED);
- }
- crm_info("Waiting for the TE to disconnect");
- do_exit = FALSE;
-
- } else if(is_set(fsa_input_register, R_HA_DISCONNECTED) ==
FALSE) {
- do_ha_control(A_HA_DISCONNECT,
- cause, cur_state, current_input,
msg_data);
- do_exit = FALSE;
- }
-
- if(do_exit) {
- crm_info("Performing %s - gracefully exiting the CRMd",
- fsa_action2string(action));
- }
-
- } else {
+ if(action & A_EXIT_1) {
exit_code = 1;
- crm_warn("Performing %s - forcefully exiting the CRMd... now!",
- fsa_action2string(action));
- }
-
- if(do_exit) {
- if(is_set(fsa_input_register, R_IN_RECOVERY)) {
- crm_info("Could not recover from internal error");
- exit_code = 2;
-
- } else if(is_set(fsa_input_register, R_STAYDOWN)) {
- crm_info("Inhibiting respawn by Heartbeat");
- exit_code = 100;
- }
- crm_info("[%s] stopped (%d)", crm_system_name, exit_code);
- exit(exit_code);
-
- } else {
- crmd_fsa_stall(NULL);
+ log_level = LOG_ERR;
+ exit_type = "forcefully";
}
+ crm_log_maybe(log_level, "Performing %s - %s exiting the CRMd",
+ fsa_action2string(action), exit_type);
+ if(is_set(fsa_input_register, R_IN_RECOVERY)) {
+ crm_err("Could not recover from internal error");
+ exit_code = 2;
+
+ } else if(is_set(fsa_input_register, R_STAYDOWN)) {
+ crm_warn("Inhibiting respawn by Heartbeat");
+ exit_code = 100;
+ }
+
+ crm_info("[%s] stopped (%d)", crm_system_name, exit_code);
+ exit(exit_code);
+
return I_NULL;
}
@@ -337,22 +300,20 @@
finalization_timer->fsa_input = I_FINALIZED;
finalization_timer->callback = crm_timer_popped;
finalization_timer->repeat = FALSE;
-#if 0
/* for possible enabling... a bug in the join protocol left
* a slave in S_PENDING while we think its in S_NOT_DC
*
* raising I_FINALIZED put us into a transition loop which is
* never resolved.
- * in this loop we continually send probes which the node
NACK's because
- * its in S_PENDING
+ * in this loop we continually send probes which the node
+ * NACK's because its in S_PENDING
*
- * the flip-side is if we have nodes where heartbeat is active
but the
- * CRM is not... then we'll be stuck in an election/join loop
- *
- * we just cant win
+ * if we have nodes where heartbeat is active but the
+ * CRM is not... then this will be handled in the
+ * integration phase
*/
finalization_timer->fsa_input = I_ELECTION;
-#endif
+
} else {
was_error = TRUE;
}
@@ -476,10 +437,20 @@
enum crmd_fsa_input current_input,
fsa_data_t *msg_data)
{
+ crm_debug_2("Stopping all remaining local resources");
+ if(is_set(fsa_input_register, R_LRM_CONNECTED)) {
+ stop_all_resources();
+
+ } else {
+ crm_err("Exiting with no LRM connection..."
+ " resources may be active!");
+ }
if(g_hash_table_size(shutdown_ops) > 0) {
- crm_err("%d stop operations outstanding at exit",
+ crm_info("Waiting on %d stop operations to complete",
g_hash_table_size(shutdown_ops));
+ crmd_fsa_stall(NULL);
+ return I_NULL;
}
return I_NULL;
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/crmd_fsa.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- crmd_fsa.h 10 Jan 2006 13:46:42 -0000 1.46
+++ crmd_fsa.h 14 Feb 2006 11:55:07 -0000 1.47
@@ -1,4 +1,4 @@
-/* $Id: crmd_fsa.h,v 1.46 2006/01/10 13:46:42 andrew Exp $ */
+/* $Id: crmd_fsa.h,v 1.47 2006/02/14 11:55:07 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -62,6 +62,7 @@
const char* command; /* Command with path */
const char* args; /* Command arguments */
+ gboolean sent_kill;
IPC_Channel *ipc; /* How can we communicate with it */
long long flag_connected; /* */
long long flag_required; /* */
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/fsa.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -3 -r1.136 -r1.137
--- fsa.c 10 Feb 2006 06:45:55 -0000 1.136
+++ fsa.c 14 Feb 2006 11:55:07 -0000 1.137
@@ -252,8 +252,10 @@
fsa_state2string(fsa_state),
fsa_cause2string(fsa_data->fsa_cause),
fsa_data->origin);
-/* } else if(fsa_actions == A_EXIT_0) { */
-/* crm_log_level = LOG_DEBUG_2; */
+ }
+
+ if(fsa_actions & A_SHUTDOWN) {
+ crm_log_level = LOG_DEBUG_2;
}
#ifdef FSA_TRACE
@@ -715,6 +717,10 @@
" eligable to run resources.",
fsa_membership_copy->members_size);
+ } else if(g_hash_table_size(confirmed_nodes) >
fsa_membership_copy->members_size) {
+ crm_err("We have more confirmed nodes than our
membership does");
+ register_fsa_input(C_FSA_INTERNAL, I_ELECTION,
NULL);
+
} else {
crm_warn("Only %u of %u cluster "
"nodes are eligable to run resources",
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/fsa_defines.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -3 -r1.43 -r1.44
--- fsa_defines.h 10 Feb 2006 05:41:20 -0000 1.43
+++ fsa_defines.h 14 Feb 2006 11:55:07 -0000 1.44
@@ -1,4 +1,4 @@
-/* $Id: fsa_defines.h,v 1.43 2006/02/10 05:41:20 andrew Exp $ */
+/* $Id: fsa_defines.h,v 1.44 2006/02/14 11:55:07 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -396,7 +396,7 @@
#define A_ERROR 0x2000000000000000ULL
#define A_WARN 0x4000000000000000ULL
-#define O_EXIT (A_STOP|A_CCM_DISCONNECT|A_LRM_DISCONNECT|A_EXIT_0|A_CIB_STOP)
+#define O_EXIT
(A_STOP|A_CCM_DISCONNECT|A_LRM_DISCONNECT|A_HA_DISCONNECT|A_EXIT_0|A_CIB_STOP)
#define O_RELEASE
(A_DC_TIMER_STOP|A_DC_RELEASE|A_PE_STOP|A_TE_STOP|A_DC_RELEASED)
#define O_DC_TIMER_RESTART (A_NOTHING)
#define O_PE_RESTART (A_PE_START|A_PE_STOP)
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/fsa_matrix.h,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -3 -r1.64 -r1.65
--- fsa_matrix.h 13 Jan 2006 19:02:38 -0000 1.64
+++ fsa_matrix.h 14 Feb 2006 11:55:07 -0000 1.65
@@ -1075,7 +1075,7 @@
/* S_RELEASE_DC ==> */ A_ERROR|A_SHUTDOWN|O_EXIT,
/* S_STARTING ==> */ O_EXIT,
/* S_PENDING ==> */ A_ERROR|O_EXIT,
- /* S_STOPPING ==> */ A_SHUTDOWN|O_EXIT,
+ /* S_STOPPING ==> */ O_EXIT,
/* S_TERMINATE ==> */ O_EXIT,
/* S_TRANSITION_ENGINE ==> */ A_ERROR|A_SHUTDOWN|O_EXIT,
/* S_HALT ==> */ A_ERROR|A_SHUTDOWN|O_EXIT,
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/lrm.c,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -3 -r1.163 -r1.164
--- lrm.c 8 Feb 2006 22:18:59 -0000 1.163
+++ lrm.c 14 Feb 2006 11:55:07 -0000 1.164
@@ -297,8 +297,10 @@
rsc_id, char, lrm_list, lpc,
if(is_rsc_active(rsc_id)) {
- crm_warn("Resource %s was active at shutdown", rsc_id);
- do_lrm_rsc_op(NULL, rsc_id, CRMD_ACTION_STOP, NULL,
NULL);
+ crm_err("Resource %s was active at shutdown."
+ " You may ignore this error if it is
unmanaged.",
+ rsc_id);
+/* do_lrm_rsc_op(NULL, rsc_id, CRMD_ACTION_STOP, NULL,
NULL); */
}
);
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/messages.c,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -3 -r1.143 -r1.144
--- messages.c 3 Feb 2006 15:52:04 -0000 1.143
+++ messages.c 14 Feb 2006 11:55:07 -0000 1.144
@@ -1152,10 +1152,10 @@
}
if(all_is_good == FALSE) {
- log_level = LOG_ERR;
- }
-
- if(log_level == LOG_ERR
+ log_level = LOG_WARNING;
+ }
+
+ if(log_level == LOG_WARNING
|| (safe_str_neq(op, CRM_OP_HBEAT))) {
do_crm_log(log_level, __FILE__, __FUNCTION__,
"Sending %sHA message (ref=%s) to [EMAIL PROTECTED]
%s.",
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/subsystems.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -3 -r1.92 -r1.93
--- subsystems.c 10 Feb 2006 05:18:22 -0000 1.92
+++ subsystems.c 14 Feb 2006 11:55:07 -0000 1.93
@@ -64,10 +64,16 @@
{
struct crm_subsystem_s *the_subsystem = p->privatedata;
+ crm_info("Process %s:[%d] exited (signal=%d, exitcode=%d)",
+ the_subsystem->name, the_subsystem->pid, signo, exitcode);
+
the_subsystem->pid = -1;
- the_subsystem->ipc = NULL;
+ the_subsystem->ipc = NULL;
clear_bit_inplace(fsa_input_register, the_subsystem->flag_connected);
+ crm_debug_3("Triggering FSA: %s", __FUNCTION__);
+ G_main_set_trigger(fsa_source);
+
if(is_set(fsa_input_register, the_subsystem->flag_required)) {
/* this wasnt supposed to happen */
crm_err("The %s subsystem terminated unexpectedly",
@@ -93,9 +99,9 @@
};
gboolean
-stop_subsystem(struct crm_subsystem_s* the_subsystem, gboolean force_quit)
+stop_subsystem(struct crm_subsystem_s *the_subsystem, gboolean force_quit)
{
- IPC_Channel *client_channel = the_subsystem->ipc;
+ int quit_signal = SIGTERM;
crm_debug_2("Stopping sub-system \"%s\"", the_subsystem->name);
clear_bit_inplace(fsa_input_register, the_subsystem->flag_required);
@@ -103,30 +109,31 @@
crm_debug_2("Client %s not running", the_subsystem->name);
return FALSE;
- } else if(FALSE == is_set(
- fsa_input_register, the_subsystem->flag_connected)) {
+ }
+
+ if(is_set(fsa_input_register, the_subsystem->flag_connected) == FALSE) {
/* running but not yet connected */
- crm_warn("Stopping %s before it had connected",
- the_subsystem->name);
-
- CL_KILL(the_subsystem->pid, SIGTERM);
- the_subsystem->pid = -1;
-
- } else if(client_channel == NULL
- || client_channel->ops->get_chan_status(
- client_channel) != IPC_CONNECT) {
- crm_debug("Client %s has already quit", the_subsystem->name);
+ crm_debug("Stopping %s before it had connected",
+ the_subsystem->name);
+ }
+/*
+ if(force_quit && the_subsystem->sent_kill == FALSE) {
+ quit_signal = SIGKILL;
} else if(force_quit) {
- CL_KILL(the_subsystem->pid, SIGTERM);
+ crm_debug("Already sent -KILL to %s: [%d]",
+ the_subsystem->name, the_subsystem->pid);
+ }
+*/
+ errno = 0;
+ if(CL_KILL(the_subsystem->pid, quit_signal) == 0) {
+ crm_info("Sent -TERM to %s: [%d]",
+ the_subsystem->name, the_subsystem->pid);
+ the_subsystem->sent_kill = TRUE;
} else {
- HA_Message *quit = create_request(
- CRM_OP_QUIT, NULL, NULL, the_subsystem->name,
- AM_I_DC?CRM_SYSTEM_DC:CRM_SYSTEM_CRMD, NULL);
-
- crm_info("Sending quit message to %s.", the_subsystem->name);
- crm_send_ipc_message(client_channel, quit, TRUE);
+ cl_perror("Sent -TERM to %s: [%d]",
+ the_subsystem->name, the_subsystem->pid);
}
return TRUE;
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/utils.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -3 -r1.84 -r1.85
--- utils.c 17 Jan 2006 13:24:24 -0000 1.84
+++ utils.c 14 Feb 2006 11:55:07 -0000 1.85
@@ -1336,8 +1336,13 @@
if(the_subsystem != NULL) {
the_subsystem->ipc = NULL;
+ crm_info("Received HUP from %s:[%d]",
+ the_subsystem->name, the_subsystem->pid);
- } /* else that was a transient client */
+ } else {
+ /* else that was a transient client */
+ crm_debug("Received HUP from transient client");
+ }
if (curr_client->table_key != NULL) {
/*
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 27, Issue 55
********************************************