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: crm by andrew from 
      ([email protected])
   2. Linux-HA CVS: crm by andrew from 
      ([email protected])


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

Message: 1
Date: Mon, 16 Jan 2006 02:16:33 -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/pengine


Modified Files:
        main.c pengine.c pengine.h 


Log Message:
Three new ha.cf options:
 - record_config_changes (on/off)
 on: the current implementation logs config changes at the value of "debug"
 off: the current implementation logs config changes at the value of "debug" + 1
 - record_pengine_inputs (on/off)
 on: the current implementation logs config changes at the value of "debug"
 off: the current implementation logs config changes at the value of "debug" + 1
 - enable_config_writes (on/off)
 on: write (CIB) config changes to disk
 off: do NOT write (CIB) config changes to disk

Remove the old enable_config_writes option from the CIB, it was broken and
  required linking against the pengine library to fix as correct interpretation
  required understanding the CIB's contents.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/main.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- main.c      20 May 2005 09:58:43 -0000      1.18
+++ main.c      16 Jan 2006 09:16:32 -0000      1.19
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.18 2005/05/20 09:58:43 andrew Exp $ */
+/* $Id: main.c,v 1.19 2006/01/16 09:16:32 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -29,8 +29,10 @@
 #include <fcntl.h>
 
 #include <hb_api.h>
+#include <heartbeat.h>
 #include <clplumbing/uids.h>
 #include <clplumbing/coredumps.h>
+#include <clplumbing/cl_misc.h>
 
 #include <crm/common/ipc.h>
 #include <crm/common/ctrl.h>
@@ -48,13 +50,16 @@
 int init_start(void);
 gboolean pengine_shutdown(int nsig, gpointer unused);
 extern gboolean process_pe_message(crm_data_t * msg, IPC_Channel *sender);
+extern unsigned int pengine_input_loglevel;
 
 int
 main(int argc, char ** argv)
 {
-       gboolean allow_cores = TRUE;
-       int     argerr = 0;
        int flag;
+       int argerr = 0;
+       char *param_val = NULL;
+       gboolean allow_cores = TRUE;
+       const char *param_name = NULL;
     
        crm_log_init(crm_system_name);
        G_main_add_SignalHandler(
@@ -84,7 +89,20 @@
        if (argerr) {
                usage(crm_system_name,LSB_EXIT_GENERIC);
        }
-    
+
+       param_name = ENV_PREFIX "" KEY_LOG_PENGINE_INPUTS;
+       param_val = getenv(param_name);
+       crm_debug("%s = %s", param_name, param_val);
+       pengine_input_loglevel = crm_log_level;
+       if(param_val != NULL) {
+               int do_log = 0;
+               cl_str_to_boolean(param_val, &do_log);
+               if(do_log == FALSE) {
+                       pengine_input_loglevel = crm_log_level + 1;
+               }
+               param_val = NULL;
+       }
+       
        /* read local config file */
        crm_debug_4("do start");
        return init_start();
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/pengine.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -3 -r1.101 -r1.102
--- pengine.c   12 Jan 2006 15:11:42 -0000      1.101
+++ pengine.c   16 Jan 2006 09:16:32 -0000      1.102
@@ -1,4 +1,4 @@
-/* $Id: pengine.c,v 1.101 2006/01/12 15:11:42 andrew Exp $ */
+/* $Id: pengine.c,v 1.102 2006/01/16 09:16:32 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -39,6 +39,7 @@
 gboolean was_processing_warning = FALSE;
 gboolean was_config_error = FALSE;
 gboolean was_config_warning = FALSE;
+unsigned int pengine_input_loglevel = LOG_INFO;
 
 gboolean
 process_pe_message(HA_Message *msg, crm_data_t * xml_data, IPC_Channel *sender)
@@ -72,8 +73,7 @@
 
                copy_in_properties(generation, xml_data);
                crm_log_xml_info(generation, "[generation]");
-               crm_log_xml_info(status, "[status]");
-
+               
 #if 0
                char *xml_buffer = NULL;
                char *xml_buffer_ptr = NULL;
@@ -124,12 +124,20 @@
                        crm_log_xml_info(log_input, "[input]");
 
                } else if(was_processing_warning) {
-                       crm_debug("WARNINGs found during PE processing."
-                               "  Input follows:");
-                       crm_log_xml_debug(log_input, "[input]");
+                       crm_log_maybe(pengine_input_loglevel-1,
+                                     "WARNINGs found during PE processing."
+                                     "  Input follows:");
+                       crm_log_xml(pengine_input_loglevel-1,
+                                   "[input]", status);
+
+               } else {
+                       if(crm_log_level > LOG_DEBUG) {
+                               crm_log_xml_debug_2(log_input, "[input]");
 
-               } else if(crm_log_level > LOG_DEBUG) {
-                       crm_log_xml_debug_2(log_input, "[input]");
+                       } else {
+                               crm_log_xml(pengine_input_loglevel,
+                                           "[status]", status);
+                       }
                }
 
                if(was_config_error) {
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/pengine.h,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -3 -r1.103 -r1.104
--- pengine.h   7 Jan 2006 21:00:24 -0000       1.103
+++ pengine.h   16 Jan 2006 09:16:32 -0000      1.104
@@ -1,4 +1,4 @@
-/* $Id: pengine.h,v 1.103 2006/01/07 21:00:24 andrew Exp $ */
+/* $Id: pengine.h,v 1.104 2006/01/16 09:16:32 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -485,6 +485,7 @@
 extern gboolean was_processing_warning;
 extern gboolean was_config_error;
 extern gboolean was_config_warning;
+extern unsigned int pengine_input_loglevel;
 
 #endif
 




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

Message: 2
Date: Mon, 16 Jan 2006 02:16:33 -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/cib


Modified Files:
        cibio.h io.c main.c 


Log Message:
Three new ha.cf options:
 - record_config_changes (on/off)
 on: the current implementation logs config changes at the value of "debug"
 off: the current implementation logs config changes at the value of "debug" + 1
 - record_pengine_inputs (on/off)
 on: the current implementation logs config changes at the value of "debug"
 off: the current implementation logs config changes at the value of "debug" + 1
 - enable_config_writes (on/off)
 on: write (CIB) config changes to disk
 off: do NOT write (CIB) config changes to disk

Remove the old enable_config_writes option from the CIB, it was broken and
  required linking against the pengine library to fix as correct interpretation
  required understanding the CIB's contents.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/cibio.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- cibio.h     31 May 2005 14:50:46 -0000      1.13
+++ cibio.h     16 Jan 2006 09:16:32 -0000      1.14
@@ -1,4 +1,4 @@
-/* $Id: cibio.h,v 1.13 2005/05/31 14:50:46 andrew Exp $ */
+/* $Id: cibio.h,v 1.14 2006/01/16 09:16:32 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -39,6 +39,7 @@
 extern crm_data_t *resource_search;
 extern crm_data_t *constraint_search;
 extern crm_data_t *status_search;
+extern unsigned int cib_diff_loglevel;
 
 extern crm_data_t *get_the_CIB(void);
 
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/io.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- io.c        11 Jan 2006 13:06:11 -0000      1.39
+++ io.c        16 Jan 2006 09:16:32 -0000      1.40
@@ -1,4 +1,4 @@
-/* $Id: io.c,v 1.39 2006/01/11 13:06:11 andrew Exp $ */
+/* $Id: io.c,v 1.40 2006/01/16 09:16:32 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -72,7 +72,7 @@
 crm_data_t *constraint_search = NULL;
 crm_data_t *status_search = NULL;
 
-gboolean cib_writes_enabled = TRUE;
+extern gboolean cib_writes_enabled;
 extern char *ccm_transition_id;
 extern gboolean cib_have_quorum;
 extern GHashTable *peer_hash;
@@ -258,45 +258,6 @@
                the_cib = NULL;
 
        } else {
-               const char *option = "suppress_cib_writes";
-               const char *value = NULL;
-               crm_data_t *config = get_object_root(
-                       XML_CIB_TAG_CRMCONFIG, new_cib);
-               
-               crm_data_t * a_default = find_entity(
-                       config, XML_CIB_TAG_NVPAIR, option);
-
-               if(a_default != NULL) {
-                       value = crm_element_value(
-                               a_default, XML_NVPAIR_ATTR_VALUE);
-               }
-
-               if(value == NULL) {
-                       crm_warn("Option %s not set", option);
-                       if(cib_writes_enabled == FALSE) {
-                               crm_debug("Disk writes to %s enabled",
-                                         CIB_FILENAME);
-                       }
-                       cib_writes_enabled = TRUE;
-                       
-               } else {
-                       gboolean suppress = FALSE;
-                       cl_str_to_boolean(value, &suppress);
-                       if(cib_writes_enabled == suppress) {
-                               cib_writes_enabled = !suppress;
-                               if(cib_writes_enabled) {
-                                       crm_debug("Disk writes to %s enabled",
-                                                 CIB_FILENAME);
-                               } else {
-                                       crm_notice("Disabling CIB disk writes");
-                               }
-                       }
-               }               
-               
-               crm_debug_2("Disk writes to %s %s", CIB_FILENAME,
-                           cib_writes_enabled?"enabled":"DISABLED");
-
-
                set_connected_peers(the_cib);
                set_transition(the_cib);
                if(cib_have_quorum) {
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/main.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -3 -r1.31 -r1.32
--- main.c      12 Jan 2006 15:02:53 -0000      1.31
+++ main.c      16 Jan 2006 09:16:32 -0000      1.32
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.31 2006/01/12 15:02:53 andrew Exp $ */
+/* $Id: main.c,v 1.32 2006/01/16 09:16:32 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -30,6 +30,8 @@
 #include <fcntl.h>
 
 #include <hb_api.h>
+#include <heartbeat.h>
+#include <clplumbing/cl_misc.h>
 #include <clplumbing/uids.h>
 #include <clplumbing/coredumps.h>
 #include <clplumbing/Gmain_timeout.h>
@@ -52,6 +54,7 @@
 #include <crm/dmalloc_wrapper.h>
 
 gboolean cib_shutdown_flag = FALSE;
+unsigned int cib_diff_loglevel = LOG_INFO;
 
 extern void oc_ev_special(const oc_ev_t *, oc_ev_class_t , int );
 
@@ -59,6 +62,7 @@
 const char* crm_system_name = CRM_SYSTEM_CIB;
 char *cib_our_uname = NULL;
 oc_ev_t *cib_ev_token;
+gboolean cib_writes_enabled = TRUE;
 
 void usage(const char* cmd, int exit_status);
 int init_start(void);
@@ -75,8 +79,10 @@
 int
 main(int argc, char ** argv)
 {
-       int argerr = 0;
        int flag;
+       int argerr = 0;
+       char *param_val = NULL;
+       const char *param_name = NULL;
 
        crm_log_init(crm_system_name);
        G_main_add_SignalHandler(
@@ -108,11 +114,36 @@
                usage(crm_system_name,LSB_EXIT_GENERIC);
        }
     
+       /* apparently we're not allowed to free the result of getenv */
+       param_name = ENV_PREFIX "" KEY_CONFIG_WRITES_ENABLED;
+       param_val = getenv(param_name);
+       crm_debug("%s = %s", param_name, param_val);
+       if(param_val != NULL) {
+               cl_str_to_boolean(param_val, &cib_writes_enabled);
+               param_val = NULL;
+       }
+       crm_info("Disk writes to %s: %s", CIB_FILENAME,
+                cib_writes_enabled?"enabled":"DISABLED");
+
+       param_name = ENV_PREFIX "" KEY_LOG_CONFIG_CHANGES;
+       param_val = getenv(param_name);
+       crm_debug("%s = %s", param_name, param_val);
+       cib_diff_loglevel = crm_log_level;
+       if(param_val != NULL) {
+               int do_log = 0;
+               cl_str_to_boolean(param_val, &do_log);
+               if(do_log == FALSE) {
+                       cib_diff_loglevel = crm_log_level + 1;
+               }
+               param_val = NULL;
+       }
+       crm_info("Configuration changes logged at: debug %d",
+                cib_diff_loglevel - LOG_INFO);
+
        /* read local config file */
        return init_start();
 }
 
-
 int
 init_start(void)
 {




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

_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 26, Issue 35
********************************************

Reply via email to