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: heartbeat by msoffen from (linux-ha-cvs@lists.linux-ha.org) 2. Linux-HA CVS: lrm by lars from (linux-ha-cvs@lists.linux-ha.org) 3. Linux-HA CVS: lrm by zhenh from (linux-ha-cvs@lists.linux-ha.org) ---------------------------------------------------------------------- Message: 1 Date: Mon, 14 Aug 2006 14:00:56 -0600 (MDT) From: linux-ha-cvs@lists.linux-ha.org Subject: [Linux-ha-cvs] Linux-HA CVS: heartbeat by msoffen from To: [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> linux-ha CVS committal Author : msoffen Host : Project : linux-ha Module : heartbeat Dir : linux-ha/heartbeat/lib Modified Files: ResourceManager.in Log Message: Fixed so that SSH and REBOOT are taken from the config settings. =================================================================== RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/lib/ResourceManager.in,v retrieving revision 1.33 retrieving revision 1.34 diff -u -3 -r1.33 -r1.34 --- ResourceManager.in 20 Sep 2005 16:06:46 -0000 1.33 +++ ResourceManager.in 14 Aug 2006 20:00:55 -0000 1.34 @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: ResourceManager.in,v 1.33 2005/09/20 16:06:46 alan Exp $ +# $Id: ResourceManager.in,v 1.34 2006/08/14 20:00:55 msoffen Exp $ # # Support: [EMAIL PROTECTED] # License: GNU General Public License (GPL) @@ -417,7 +417,7 @@ pkill -9 $name done if - [ -x /sbin/reboot ] && /sbin/reboot -f + [ -x @REBOOT@ ] && @REBOOT@ @REBOOT_OPTIONS@ then : OK - reboot succeeded elif @@ -456,6 +456,9 @@ # # $Log: ResourceManager.in,v $ +# Revision 1.34 2006/08/14 20:00:55 msoffen +# Fixed so that SSH and REBOOT are taken from the config settings. +# # Revision 1.33 2005/09/20 16:06:46 alan # Fixed the code to only give up failed resource types... # ------------------------------ Message: 2 Date: Mon, 14 Aug 2006 14:19:21 -0600 (MDT) From: linux-ha-cvs@lists.linux-ha.org Subject: [Linux-ha-cvs] Linux-HA CVS: lrm by lars from To: [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> linux-ha CVS committal Author : lars Host : Project : linux-ha Module : lrm Dir : linux-ha/lrm/lrmd Modified Files: lrmd.c Log Message: Minor code cleanups. =================================================================== RCS file: /home/cvs/linux-ha/linux-ha/lrm/lrmd/lrmd.c,v retrieving revision 1.235 retrieving revision 1.236 diff -u -3 -r1.235 -r1.236 --- lrmd.c 11 Aug 2006 00:11:59 -0000 1.235 +++ lrmd.c 14 Aug 2006 20:19:20 -0000 1.236 @@ -1,4 +1,4 @@ -/* $Id: lrmd.c,v 1.235 2006/08/11 00:11:59 zhenh Exp $ */ +/* $Id: lrmd.c,v 1.236 2006/08/14 20:19:20 lars Exp $ */ /* * Local Resource Manager Daemon * @@ -58,6 +58,7 @@ #include <lrm/lrm_msg.h> #include <lrm/raexec.h> +/* TODO: move to internal header */ #define MAX_PID_LEN 256 #define MAX_PROC_NAME 256 #define MAX_MSGTYPELEN 32 @@ -71,6 +72,8 @@ /* Donnot directly use the definition in heartbeat.h/hb_api.h for fewer * dependency, but need to keep identical with them. + * + * TODO: If it is common, it should come from a common header. */ #define ENV_PREFIX "HA_" #define KEY_LOGDAEMON "use_logd" @@ -114,14 +117,14 @@ #define CHECK_RETURN_OF_CREATE_LRM_RET \ if (NULL == msg) { \ lrmd_log(LOG_ERR \ - , "%s: can not create a ret message with create_lrm_ret." \ + , "%s: cannot create a ret message with create_lrm_ret." \ , __FUNCTION__); \ return HA_FAIL; \ } #define LOG_FAILED_TO_ADD_FIELD(field) \ lrmd_log(LOG_ERR \ - , "%s:%d: can not add the field %s to a message." \ + , "%s:%d: cannot add the field %s to a message." \ , __FUNCTION__ \ , __LINE__ \ , field); @@ -230,7 +233,7 @@ }; -/* For read the output from RAs' execution ( its children ) */ +/* For reading the output from executing the RA */ struct ra_pipe_op { /* The same value of the one in corresponding lrmd_op */ @@ -247,6 +250,9 @@ char * rsc_class; }; +/* TODO: This ought to be broken up into several source files for easier + * reading and debugging. */ + /* Debug oriented funtions */ static gboolean debug_level_adjust(int nsig, gpointer user_data); static void dump_data_for_debug(void); @@ -362,9 +368,9 @@ static gboolean shutdown_in_progress = FALSE; static unsigned long apphb_interval = 2000; /* Millisecond */ static gboolean reg_to_apphbd = FALSE; -static int MAX_CHILD_NUMBER = 4; -static int INTERVAL_RETRY = 1000; /* Millisecond */ -static int child_number = 0; +static int max_children = 4; +static int retry_interval = 1000; /* Millisecond */ +static int child_count = 0; /* * Daemon functions @@ -1798,6 +1804,8 @@ rsc = lookup_rsc(op->rsc_id); on_op_done(op); + /* TODO: This seems to always execute the next operation queued + * for the resource when the previous one expired - why? */ if (rsc != NULL) { perform_op(rsc); } @@ -1836,6 +1844,10 @@ op->repeat_timeout_tag = (guint)-1; } + /* FIXME: Is there a special reason for setting + * op->repeat_timeout_tag twice, and if so, why does the cast to + * (guint) matter once but not twice? */ + op->repeat_timeout_tag = -1; op->exec_pid = -1; op->timeout_tag = -1; @@ -3068,39 +3080,37 @@ GList* node = NULL; lrmd_op_t* op = NULL; - CHECK_ALLOCATED(rsc, "resource", HA_FAIL ); + CHECK_ALLOCATED(rsc, "resource", HA_FAIL); if (TRUE == shutdown_in_progress && can_shutdown()) { lrm_shutdown(); } if (NULL == rsc->op_list) { - lrmd_debug2(LOG_DEBUG,"perform_op: no op to perform"); + lrmd_debug2(LOG_DEBUG,"perform_op: no op to perform?"); return HA_OK; } node = g_list_first(rsc->op_list); - while ( NULL != node ) { + while (NULL != node) { op = node->data; - if (-1 != op->exec_pid ) { - lrmd_debug(LOG_DEBUG, "perform_op: current op is performing."); - lrmd_debug(LOG_DEBUG, "perform_op: its information: %s." + if (-1 != op->exec_pid) { + lrmd_debug(LOG_DEBUG, "perform_op: current op for rsc is already running."); + lrmd_debug(LOG_DEBUG, "perform_op: its information: %s" , op_info(op)); break; } - if (child_number >= MAX_CHILD_NUMBER) { + if (child_count >= max_children) { lrmd_debug2(LOG_NOTICE - , "Because the child number reachs the maximum" - " %d, the operations are postponed to execute" - " behind and including this: %s " - , MAX_CHILD_NUMBER - , op_info(op)); - rsc->delay_timeout = Gmain_timeout_add(INTERVAL_RETRY + , "max_child_count (%d) reached, postponing " + "execution of %s by %d ms", + , max_children, op_info(op), retry_interval); + rsc->delay_timeout = Gmain_timeout_add(retry_interval , rsc_execution_freeze_timeout, rsc); break; } - if ( HA_OK != perform_ra_op(op)) { + if (HA_OK != perform_ra_op(op)) { lrmd_log(LOG_ERR , "unable to perform_ra_op on %s" , op_info(op)); @@ -3207,7 +3217,7 @@ return HA_FAIL; default: /* Parent */ - child_number++; + child_count++; NewTrackedProc(pid, 1, PT_LOGNONE, op, &ManagedChildTrackOps); close(stdout_fd[1]); @@ -3296,9 +3306,9 @@ int ret; int op_status; - if (--child_number < 0) { + if (--child_count < 0) { lrmd_log(LOG_ERR, "%s:%d: child number is less than zero: %d" - , __FUNCTION__, __LINE__, child_number); + , __FUNCTION__, __LINE__, child_count); } CHECK_ALLOCATED(p, "ProcTrack p", ); @@ -3886,6 +3896,9 @@ } /* * $Log: lrmd.c,v $ + * Revision 1.236 2006/08/14 20:19:20 lars + * Minor code cleanups. + * * Revision 1.235 2006/08/11 00:11:59 zhenh * downgrade some general log * ------------------------------ Message: 3 Date: Mon, 14 Aug 2006 19:48:55 -0600 (MDT) From: linux-ha-cvs@lists.linux-ha.org Subject: [Linux-ha-cvs] Linux-HA CVS: lrm by zhenh from To: [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> linux-ha CVS committal Author : zhenh Host : Project : linux-ha Module : lrm Dir : linux-ha/lrm/lrmd Modified Files: lrmd.c Log Message: remove the more comma =================================================================== RCS file: /home/cvs/linux-ha/linux-ha/lrm/lrmd/lrmd.c,v retrieving revision 1.236 retrieving revision 1.237 diff -u -3 -r1.236 -r1.237 --- lrmd.c 14 Aug 2006 20:19:20 -0000 1.236 +++ lrmd.c 15 Aug 2006 01:48:55 -0000 1.237 @@ -1,4 +1,4 @@ -/* $Id: lrmd.c,v 1.236 2006/08/14 20:19:20 lars Exp $ */ +/* $Id: lrmd.c,v 1.237 2006/08/15 01:48:55 zhenh Exp $ */ /* * Local Resource Manager Daemon * @@ -3103,7 +3103,7 @@ if (child_count >= max_children) { lrmd_debug2(LOG_NOTICE , "max_child_count (%d) reached, postponing " - "execution of %s by %d ms", + "execution of %s by %d ms" , max_children, op_info(op), retry_interval); rsc->delay_timeout = Gmain_timeout_add(retry_interval , rsc_execution_freeze_timeout, rsc); @@ -3896,6 +3896,9 @@ } /* * $Log: lrmd.c,v $ + * Revision 1.237 2006/08/15 01:48:55 zhenh + * remove the more comma + * * Revision 1.236 2006/08/14 20:19:20 lars * Minor code cleanups. * ------------------------------ _______________________________________________ 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 33, Issue 30 ********************************************