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: include by andrew from 
      (linux-ha-cvs@lists.linux-ha.org)


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

Message: 1
Date: Thu, 22 Jun 2006 09:11:57 -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 


Log Message:
When the CIB is misconfigured, instead of shutting down (and the CRM respawning
  over and over), stay up and let clients know why the CIB is not processing
  requests.
This allows the crmd to tell heartbeat not to keep respawning it (because it
  will never successfully start)

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/control.c,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -3 -r1.128 -r1.129
--- control.c   7 Jun 2006 12:51:16 -0000       1.128
+++ control.c   22 Jun 2006 15:11:56 -0000      1.129
@@ -192,14 +192,15 @@
        
        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)) {
+               exit_code = 2;          
+       } 
+       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);
+       cl_flush_logs();
        exit(exit_code);
 
        return I_NULL;
@@ -529,12 +530,19 @@
 {
        const char *value = NULL;
        GHashTable *config_hash = NULL;
-       
+
        if(rc != cib_ok) {
                fsa_data_t *msg_data = NULL;
                crm_err("Local CIB query resulted in an error: %s",
                        cib_error2string(rc));
                register_fsa_error(C_FSA_INTERNAL, I_ERROR, NULL);
+
+               if(rc == cib_bad_permissions
+                  || rc == cib_bad_digest
+                  || rc == cib_bad_config) {
+                       crm_err("The cluster is mis-configured - shutting down 
and staying down");
+                       set_bit_inplace(fsa_input_register, R_STAYDOWN);
+               }
                return;
        }
 
@@ -542,11 +550,9 @@
        config_hash = g_hash_table_new_full(
                g_str_hash,g_str_equal, g_hash_destroy_str,g_hash_destroy_str);
 
-#if 0
        unpack_instance_attributes(
                output, XML_CIB_TAG_PROPSET, NULL, config_hash,
                CIB_OPTIONS_FIRST, NULL);
-#endif
        
        value = g_hash_table_lookup(config_hash, XML_CONFIG_ATTR_DC_DEADTIME);
        if(value != NULL) {




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

Message: 2
Date: Thu, 22 Jun 2006 09:11:56 -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/cib


Modified Files:
        callbacks.c io.c main.c 


Log Message:
When the CIB is misconfigured, instead of shutting down (and the CRM respawning
  over and over), stay up and let clients know why the CIB is not processing
  requests.
This allows the crmd to tell heartbeat not to keep respawning it (because it
  will never successfully start)

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/callbacks.c,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -3 -r1.124 -r1.125
--- callbacks.c 22 Jun 2006 09:15:40 -0000      1.124
+++ callbacks.c 22 Jun 2006 15:11:56 -0000      1.125
@@ -1,4 +1,4 @@
-/* $Id: callbacks.c,v 1.124 2006/06/22 09:15:40 andrew Exp $ */
+/* $Id: callbacks.c,v 1.125 2006/06/22 15:11:56 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -85,6 +85,7 @@
 extern unsigned long cib_num_ops, cib_num_local, cib_num_updates, cib_num_fail;
 extern unsigned long cib_bad_connects, cib_num_timeouts;
 extern longclock_t cib_call_time;
+extern enum cib_errors cib_status;
 
 static HA_Message *
 cib_prepare_common(HA_Message *root, const char *section)
@@ -1083,6 +1084,11 @@
                /* abort */
                rc = cib_not_authorized;
        }
+
+       if(cib_status != cib_ok) {
+               *reply = cib_construct_reply(request, the_cib, cib_status);
+               return cib_status;
+       }
        
        if(rc == cib_ok
           && global_update == FALSE
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/io.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -3 -r1.70 -r1.71
--- io.c        21 Jun 2006 08:40:13 -0000      1.70
+++ io.c        22 Jun 2006 15:11:56 -0000      1.71
@@ -1,4 +1,4 @@
-/* $Id: io.c,v 1.70 2006/06/21 08:40:13 andrew Exp $ */
+/* $Id: io.c,v 1.71 2006/06/22 15:11:56 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -79,6 +79,7 @@
 extern GHashTable *peer_hash;
 extern GHashTable *ccm_membership;
 extern GTRIGSource *cib_writer;
+extern enum cib_errors cib_status;
 
 int set_connected_peers(crm_data_t *xml_obj);
 void GHFunc_count_peers(gpointer key, gpointer value, gpointer user_data);
@@ -231,9 +232,8 @@
                             && (buf.st_mode & (S_IRUSR|S_IWUSR)));
        
        if( S_ISREG(buf.st_mode) == FALSE ) {
+               cib_status = cib_bad_permissions;
                crm_err("%s must be a regular file", filename);
-               cl_flush_logs();
-               exit(100);
                
        } else if( user_readwritable == FALSE ) {
                struct group *cib_grp = getgrnam(HA_APIGROUP);
@@ -246,9 +246,9 @@
                        crm_err("%s must be owned and read/writeable by user 
%s,"
                                " or owned and read/writable by group %s",
                                filename, HA_CCMUSER, HA_APIGROUP);
-                       cl_flush_logs();
-                       exit(100);
-               }
+                       cib_status = cib_bad_permissions;
+                       return NULL;
+               } 
                crm_warn("%s should be owned and read/writeable by user %s",
                         filename, HA_CCMUSER);
        }
@@ -257,8 +257,10 @@
        if(validate_on_disk_cib(filename, &root) == FALSE) {
                valid = FALSE;
                crm_err("%s has been manually changed"
-                       " - please update the md5 digest in %s.sig",
+                       " - if this was intended, please remove the md5 digest 
in %s.sig",
                        filename, filename);
+                       cib_status = cib_bad_digest;
+                       return NULL;
        }
 
        /* Do this before DTD validation happens */
@@ -314,37 +316,27 @@
        
        if(root == NULL) {
                crm_crit("Parse ERROR reading %s.", filename);
-               crm_crit("Inhibiting respawn by Heartbeat to avoid loss"
-                        " of existing configuration data.");
-               cl_flush_logs();
-               exit(100);
-
+               cib_status = cib_bad_config;            
+               return NULL;
+               
        } else if(valid == FALSE) {
                crm_err("%s does not contain a valid configuration", filename);
-               crm_crit("Inhibiting respawn by Heartbeat to avoid loss"
-                        " of existing configuration data.");
-               cl_flush_logs();
-               exit(100);
+               cib_status = cib_bad_config;
        }
 
+       
        crm_xml_add(root, "generated", XML_BOOLEAN_FALSE);      
        
        if(do_id_check(root, NULL, FALSE, FALSE)) {
                crm_crit("%s does not contain a vaild configuration.",
                         filename);
-               crm_crit("Inhibiting respawn by Heartbeat to avoid loss"
-                        " of configuration data.");
-               cl_flush_logs();
-               exit(100);
+               cib_status = cib_bad_config;
        }
 
        if (verifyCibXml(root) == FALSE) {
                crm_crit("%s does not contain a vaild configuration.",
                         filename);
-               crm_crit("Inhibiting respawn by Heartbeat to avoid loss"
-                        " of configuration data.");
-               cl_flush_logs();
-               exit(100);
+               cib_status = cib_bad_config;
        }
 
        return root;
@@ -555,7 +547,7 @@
                                 " version to revert to");
                }
                
-       } else if(cib_writes_enabled) {
+       } else if(cib_writes_enabled && cib_status == cib_ok) {
                crm_debug_2("Triggering CIB write");
                G_main_set_trigger(cib_writer);
        }
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/main.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -3 -r1.44 -r1.45
--- main.c      22 Jun 2006 09:15:40 -0000      1.44
+++ main.c      22 Jun 2006 15:11:56 -0000      1.45
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.44 2006/06/22 09:15:40 andrew Exp $ */
+/* $Id: main.c,v 1.45 2006/06/22 15:11:56 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -55,6 +55,7 @@
 
 gboolean cib_shutdown_flag = FALSE;
 gboolean stand_alone = FALSE;
+enum cib_errors cib_status = cib_ok;
 
 extern void oc_ev_special(const oc_ev_t *, oc_ev_class_t , int );
 
@@ -100,7 +101,7 @@
 {
        int flag;
        int argerr = 0;
-
+       
        crm_log_init(crm_system_name);
        G_main_add_SignalHandler(
                G_PRIORITY_HIGH, SIGTERM, cib_shutdown, NULL, NULL);




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

Message: 3
Date: Thu, 22 Jun 2006 09:11:57 -0600 (MDT)
From: linux-ha-cvs@lists.linux-ha.org
Subject: [Linux-ha-cvs] Linux-HA CVS: include by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Project : linux-ha
Module  : include

Dir     : linux-ha/include/crm


Modified Files:
        cib.h 


Log Message:
When the CIB is misconfigured, instead of shutting down (and the CRM respawning
  over and over), stay up and let clients know why the CIB is not processing
  requests.
This allows the crmd to tell heartbeat not to keep respawning it (because it
  will never successfully start)

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/crm/cib.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -3 -r1.42 -r1.43
--- cib.h       10 Apr 2006 12:48:43 -0000      1.42
+++ cib.h       22 Jun 2006 15:11:56 -0000      1.43
@@ -1,4 +1,4 @@
-/* $Id: cib.h,v 1.42 2006/04/10 12:48:43 andrew Exp $ */
+/* $Id: cib.h,v 1.43 2006/06/22 15:11:56 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -115,7 +115,10 @@
        cib_old_data            = -45,
        cib_id_check            = -46,
        cib_dtd_validation      = -47,
-       cib_bad_section         = -48
+       cib_bad_section         = -48,
+       cib_bad_digest          = -49,
+       cib_bad_permissions     = -50,
+       cib_bad_config          = -51
 };
 
 enum cib_update_op {




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

_______________________________________________
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 31, Issue 84
********************************************

Reply via email to