Send Linux-ha-cvs mailing list submissions to
        linux-ha-cvs@lists.linux-ha.org

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: crm by andrew from 
      (linux-ha-cvs@lists.linux-ha.org)
   2. Linux-HA CVS: crm by andrew from 
      (linux-ha-cvs@lists.linux-ha.org)
   3. Linux-HA CVS: lib by sunjd from  (linux-ha-cvs@lists.linux-ha.org)


----------------------------------------------------------------------

Message: 1
Date: Mon, 10 Jul 2006 03:33:42 -0600 (MDT)
From: linux-ha-cvs@lists.linux-ha.org
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:
        control.c lrm.c 


Log Message:
Reorganise the logging of lrm ops that havent completed at shutdown

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/control.c,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -3 -r1.131 -r1.132
--- control.c   4 Jul 2006 05:58:29 -0000       1.131
+++ control.c   10 Jul 2006 09:33:40 -0000      1.132
@@ -39,7 +39,7 @@
 #include <crm/dmalloc_wrapper.h>
 
 extern void crmd_ha_connection_destroy(gpointer user_data);
-extern gboolean stop_all_resources(void);
+extern gboolean verify_stopped(gboolean force, int log_level);
 
 gboolean crm_shutdown(int nsig, gpointer unused);
 gboolean register_with_ha(ll_cluster_t *hb_cluster, const char *client_name);
@@ -185,6 +185,7 @@
                exit_code = 1;
                log_level = LOG_ERR;
                exit_type = "forcefully";
+               verify_stopped(TRUE, LOG_ERR);
        }
        
        crm_log_maybe(log_level, "Performing %s - %s exiting the CRMd",
@@ -403,14 +404,6 @@
        return I_NULL;
 }
 
-extern GHashTable *shutdown_ops;
-static void
-ghash_print_pending(gpointer key, gpointer value, gpointer user_data) 
-{
-       const char *action = key;
-       crm_debug("Pending action: %s", action);
-}
-
 /*      A_STOP */
 enum crmd_fsa_input
 do_stop(long long action,
@@ -419,37 +412,10 @@
        enum crmd_fsa_input current_input,
        fsa_data_t *msg_data)
 {
-       crm_data_t *node_state = NULL;
-       crm_debug_2("Stopping all remaining local resources");
-
-       if(g_hash_table_size(shutdown_ops) > 0) {
-               crm_info("Waiting on %d lrm operations to complete",
-                       g_hash_table_size(shutdown_ops));
-               g_hash_table_foreach(
-                       shutdown_ops, ghash_print_pending, NULL);
+       if(verify_stopped(FALSE, LOG_DEBUG) == FALSE) {
                crmd_fsa_stall(NULL);
-               return I_NULL;
-       }
-
-       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 0
-       crm_debug("Sending \"stopped\" update to CIB");
-       node_state = create_node_state(
-               fsa_our_uname, NULL, XML_BOOLEAN_FALSE, 
-               OFFLINESTATUS, CRMD_STATE_INACTIVE, NULL, FALSE, __FUNCTION__);
-
-       fsa_cib_anon_update(
-               XML_CIB_TAG_STATUS, node_state, cib_quorum_override);
-#endif
-       free_xml(node_state);
-
        return I_NULL;
 }
 
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/lrm.c,v
retrieving revision 1.200
retrieving revision 1.201
diff -u -3 -r1.200 -r1.201
--- lrm.c       7 Jul 2006 21:09:42 -0000       1.200
+++ lrm.c       10 Jul 2006 09:33:41 -0000      1.201
@@ -45,7 +45,7 @@
 #include <crm/dmalloc_wrapper.h>
 
 char *make_stop_id(const char *rsc, int call_id);
-gboolean stop_all_resources(void);
+gboolean verify_stopped(gboolean force, int log_level);
 gboolean resource_stopped(gpointer key, gpointer value, gpointer user_data);
 
 gboolean build_operation_update(
@@ -177,6 +177,7 @@
        int ret = HA_OK;
 
        if(action & A_LRM_DISCONNECT) {
+               verify_stopped(TRUE, LOG_ERR);
                if(lrm_source) {
                        crm_debug("Removing LRM connection from MainLoop");
                        if(G_main_del_IPC_Channel(lrm_source) == FALSE) {
@@ -282,39 +283,50 @@
 ghash_print_pending(gpointer key, gpointer value, gpointer user_data) 
 {
        const char *action = key;
-       crm_err("Pending action: %s", action);
+       int *log_level = user_data;
+       crm_log_maybe(*log_level, "Pending action: %s", action);
 }
 
 gboolean
-stop_all_resources(void)
+verify_stopped(gboolean force, int log_level)
 {
        GListPtr lrm_list = NULL;
 
        crm_info("Checking for active resources before exit");
-       
-       if(fsa_lrm_conn == NULL) {
-               return TRUE;
 
-       } else if(is_set(fsa_input_register, R_SENT_RSC_STOP)) {
+       if(fsa_lrm_conn == NULL) {
+               crm_err("Exiting with no LRM connection..."
+                       " resources may be active!");
                return TRUE;
        }
 
-       CRM_CHECK(g_hash_table_size(shutdown_ops) == 0,
-                 crm_err("%d pending LRM operations at shutdown",
-                         g_hash_table_size(shutdown_ops));
-                 g_hash_table_foreach(
-                       shutdown_ops, ghash_print_pending, NULL);
-               );
+       if(g_hash_table_size(shutdown_ops) > 0) {
+               crm_log_maybe(log_level,
+                             "%d pending LRM operations at shutdown%s",
+                             g_hash_table_size(shutdown_ops),
+                             force?"":"... waiting");
+
+               if(force || !is_set(fsa_input_register, R_SENT_RSC_STOP)) {
+                       g_hash_table_foreach(
+                               shutdown_ops, ghash_print_pending, &log_level);
+               }
 
+               if(force == FALSE) {
+                       return FALSE;
+               }
+       }
+       
        lrm_list = fsa_lrm_conn->lrm_ops->get_all_rscs(fsa_lrm_conn);
        slist_iter(
                rsc_id, char, lrm_list, lpc,
 
-               if(is_rsc_active(rsc_id)) {
-                       crm_err("Resource %s was active at shutdown."
-                               "  You may ignore this error if it is 
unmanaged.",
-                               rsc_id);
+               if(is_rsc_active(rsc_id) == FALSE) {
+                       continue;
                }
+               
+               crm_err("Resource %s was active at shutdown."
+                       "  You may ignore this error if it is unmanaged.",
+                       rsc_id);
                );
 
        set_bit_inplace(fsa_input_register, R_SENT_RSC_STOP);




------------------------------

Message: 2
Date: Mon, 10 Jul 2006 03:34:11 -0600 (MDT)
From: linux-ha-cvs@lists.linux-ha.org
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:
        fsa_matrix.h 


Log Message:
Eventually exit even if there are LRM operations that havent returned

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/fsa_matrix.h,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -3 -r1.71 -r1.72
--- fsa_matrix.h        25 May 2006 14:58:39 -0000      1.71
+++ fsa_matrix.h        10 Jul 2006 09:34:11 -0000      1.72
@@ -1058,7 +1058,7 @@
                /* S_STARTING           ==> */  A_SHUTDOWN,
                /* S_PENDING            ==> */  A_SHUTDOWN,
                /* S_STOPPING           ==> */  A_SHUTDOWN,
-               /* S_TERMINATE          ==> */  A_SHUTDOWN,
+               /* S_TERMINATE          ==> */  A_ERROR|A_EXIT_1,
                /* S_TRANSITION_ENGINE  ==> */  A_LOG|A_SHUTDOWN|O_RELEASE,
                /* S_HALT               ==> */  A_SHUTDOWN|O_RELEASE|A_WARN,
        },




------------------------------

Message: 3
Date: Mon, 10 Jul 2006 04:07:04 -0600 (MDT)
From: linux-ha-cvs@lists.linux-ha.org
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by sunjd from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : sunjd
Host    : 
Project : linux-ha
Module  : lib

Dir     : linux-ha/lib/plugins/lrm


Modified Files:
        raexecocf.c 


Log Message:
fix a silly error
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/plugins/lrm/raexecocf.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -3 -r1.57 -r1.58
--- raexecocf.c 9 May 2006 09:03:16 -0000       1.57
+++ raexecocf.c 10 Jul 2006 10:07:04 -0000      1.58
@@ -436,7 +436,7 @@
                        }
 
                        stat(namelist[file_num]->d_name, &prop);
-                       if (S_ISDIR(prop.st_mode)) {
+                       if (!S_ISDIR(prop.st_mode)) {
                                free(namelist[file_num]);
                                continue;
                        }




------------------------------

_______________________________________________
Linux-ha-cvs mailing list
Linux-ha-cvs@lists.linux-ha.org
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 32, Issue 37
********************************************

Reply via email to