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: resources by lars from (linux-ha-cvs@lists.linux-ha.org) 2. Linux-HA CVS: lib by sunjd from (linux-ha-cvs@lists.linux-ha.org) 3. Linux-HA CVS: tools by andrew from (linux-ha-cvs@lists.linux-ha.org) ---------------------------------------------------------------------- Message: 1 Date: Wed, 31 May 2006 16:08:11 -0600 (MDT) From: linux-ha-cvs@lists.linux-ha.org Subject: [Linux-ha-cvs] Linux-HA CVS: resources by lars from To: [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> linux-ha CVS committal Author : lars Host : Project : linux-ha Module : resources Dir : linux-ha/resources/OCF Modified Files: Filesystem.in Log Message: Novell #180303: Filesystem returned 7 instead of 0 for an already unmounted filesystem. (Shell variable scoping: Both Filesystem_stop and _status used "rc" to track their return code and it was thus overwritten inside _stop :-/) =================================================================== RCS file: /home/cvs/linux-ha/linux-ha/resources/OCF/Filesystem.in,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- Filesystem.in 28 May 2006 20:27:22 -0000 1.25 +++ Filesystem.in 31 May 2006 22:08:10 -0000 1.26 @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: Filesystem.in,v 1.25 2006/05/28 20:27:22 lars Exp $ +# $Id: Filesystem.in,v 1.26 2006/05/31 22:08:10 lars Exp $ # # Support: [EMAIL PROTECTED] # License: GNU General Public License (GPL) @@ -95,7 +95,7 @@ usage() { cat <<-EOT usage: $0 {start|stop|status|monitor|validate-all|meta-data} - $Id: Filesystem.in,v 1.25 2006/05/28 20:27:22 lars Exp $ + $Id: Filesystem.in,v 1.26 2006/05/31 22:08:10 lars Exp $ EOT } @@ -437,13 +437,9 @@ # Filesystem_stop() { - # TODO: We actually need to free up anything mounted on top of - # us too, and clear nfs exports of ourselves; otherwise, our own - # unmount process may be blocked. - # See if the device is currently mounted - if - Filesystem_status >/dev/null 2>&1 + Filesystem_status >/dev/null 2>&1 + if [ $? -ne $OCF_NOT_RUNNING ]; then then # Umount all sub-filesystems mounted under $MOUNTPOINT/ # (e.g. /proc in chroots) @@ -470,6 +466,7 @@ fi done + rc=$OCF_SUCCESS if [ $blockdevice = "yes" ]; then $UMOUNT $DEVICE DEV=$DEVICE @@ -480,26 +477,32 @@ DEV=`$MOUNT | grep "on $MOUNTPOINT " | cut -d' ' -f1` # Unmount the filesystem $UMOUNT $MOUNTPOINT - rc=$? fi - if [ $? -ne 0 ] ; then - ocf_log err "Couldn't unmount $MOUNTPOINT" - return $OCF_ERR_GENERIC - fi - flushbufs $DEV + + if [ $? -ne 0 ] ; then + ocf_log err "Couldn't unmount $MOUNTPOINT" + rc=$OCF_ERR_GENERIC + fi + flushbufs $DEV else - : $MOUNTPOINT Not mounted. No problema! + # $MOUNTPOINT Not mounted. No problema! + rc=$OCF_SUCCESS fi # We'll never see the post-stop notification. We're gone now, # have unmounted, and thus should remove the membership. + # + # (Do so regardless of whether we were unmounted already, + # because the admin might have manually unmounted but not + # cleared up the membership directory. Bad admin, no cookie.) + # if [ "$FSTYPE" = "ocfs2" ]; then - if [ ! -d "$OCFS2_FS_ROOT" ]; then - ocf_log info "$OCFS2_FS_ROOT: Filesystem membership already gone." - else - ocf_log info "$OCFS2_FS_ROOT: Removing membership directory." - rm -rf $OCFS2_FS_ROOT/ - fi + if [ ! -d "$OCFS2_FS_ROOT" ]; then + ocf_log info "$OCFS2_FS_ROOT: Filesystem membership already gone." + else + ocf_log info "$OCFS2_FS_ROOT: Removing membership directory." + rm -rf $OCFS2_FS_ROOT/ + fi fi return $rc ------------------------------ Message: 2 Date: Thu, 1 Jun 2006 00:22:34 -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/fencing Modified Files: stonithd_lib.c Log Message: log tweak =================================================================== RCS file: /home/cvs/linux-ha/linux-ha/lib/fencing/stonithd_lib.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- stonithd_lib.c 31 May 2006 09:22:50 -0000 1.22 +++ stonithd_lib.c 1 Jun 2006 06:22:33 -0000 1.23 @@ -72,10 +72,14 @@ static int chan_waitin_timeout(IPC_Channel * chan, unsigned int timeout); static int chan_waitout_timeout(IPC_Channel * chan, unsigned int timeout); static void sigalarm_handler(int signum); -static void stdlib_log(int priority, const char * fmt, ...)G_GNUC_PRINTF(2,3); static void free_stonith_ops_t(stonith_ops_t * st_op); static void free_stonithRA_ops_t(stonithRA_ops_t * ra_op); +#define stdlib_log(priority, fmt...); \ + if ( ( priority != LOG_DEBUG ) || ( DEBUG_MODE != FALSE ) ) { \ + cl_log(priority, fmt); \ + } + int stonithd_signon(const char * client_name) { @@ -293,7 +297,8 @@ /* Send the stonith request message */ if (msg2ipcchan(request, chan) != HA_OK) { ZAPMSG(request); - stdlib_log(LOG_ERR, "can't send signoff message to IPC"); + stdlib_log(LOG_ERR + , "failed to send stonith request to the stonithd"); return ST_FAIL; } @@ -316,13 +321,16 @@ if ( TRUE == is_expected_msg(reply, F_STONITHD_TYPE, ST_APIRPL, F_STONITHD_APIRPL, ST_RSTONITH) ) { - if ( ((tmpstr = cl_get_string(reply, F_STONITHD_APIRET)) != NULL) + if (((tmpstr = cl_get_string(reply, F_STONITHD_APIRET)) != NULL) && (STRNCMP_CONST(tmpstr, ST_APIOK) == 0) ) { rc = ST_OK; - stdlib_log(LOG_DEBUG, "stonith msg is sent to stonithd."); - } else { - stdlib_log(LOG_ERR, "failed to send stonith request to " - "the stonithd."); + stdlib_log(LOG_DEBUG, "%s:%d: %s" + , __FUNCTION__, __LINE__ + , "Stonithd's synchronous answer is ST_APIOK"); + } else { + stdlib_log(LOG_ERR, "%s:%d: %s" + , __FUNCTION__, __LINE__ + , "Stonithd's synchronous answer is ST_APIFAIL"); } } else { stdlib_log(LOG_ERR, "stonithd_node_fence: " @@ -381,7 +389,8 @@ F_STONITHD_APIRPL, ST_STRET) ) { stonith_ops_t * st_op = NULL; - stdlib_log(LOG_DEBUG, "received stonith final ret."); + stdlib_log(LOG_DEBUG, "received final return value of " + "a stonith operation."); /* handle the stonith op result message */ st_op = g_new(stonith_ops_t, 1); st_op->node_uuid = NULL; @@ -449,8 +458,8 @@ if ((tmpstr=cl_get_string(reply, F_STONITHD_PDATA)) != NULL) { st_op->private_data = g_strdup(tmpstr); } else { - stdlib_log(LOG_DEBUG, "stonithd_receive_ops_result: the " - "reply message contains no PDATA field."); + stdlib_log(LOG_DEBUG, "stonithd_receive_ops_result: " + "the reply message contains no PDATA field."); } if (stonith_ops_cb != NULL) { @@ -469,7 +478,8 @@ F_STONITHD_APIRPL, ST_RAOPRET ) ) { stonithRA_ops_t * ra_op = NULL; - stdlib_log(LOG_DEBUG, "received stonithRA op final ret."); + stdlib_log(LOG_DEBUG, "received the final return value of a " + "stonithRA operation."); /* handle the stonithRA op result message */ ra_op = g_new(stonithRA_ops_t, 1); @@ -698,8 +708,8 @@ } if (*types != NULL) { - stdlib_log(LOG_ERR, "stonithd_list_stonith_types: *types!=NULL," - " Will casue memory leak."); + stdlib_log(LOG_ERR, "stonithd_list_stonith_types: " + "*types!=NULL, will casue memory leak."); *types = NULL; } @@ -908,26 +918,6 @@ DEBUG_MODE = TRUE; } -/* copied from cl_log.c, need to be the same */ -#ifndef MAXLINE -# define MAXLINE 512 -#endif -static void -stdlib_log(int priority, const char * fmt, ...) -{ - va_list ap; - char buf[MAXLINE]; - - if ( DEBUG_MODE == FALSE && priority == LOG_DEBUG ) { - return; - } - - va_start(ap, fmt); - vsnprintf(buf, sizeof(buf)-1, fmt, ap); - va_end(ap); - cl_log(priority, "%s", buf); -} - static void free_stonithRA_ops_t(stonithRA_ops_t * ra_op) { ------------------------------ Message: 3 Date: Thu, 1 Jun 2006 02:43:38 -0600 (MDT) From: linux-ha-cvs@lists.linux-ha.org Subject: [Linux-ha-cvs] Linux-HA CVS: tools by andrew from To: [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> linux-ha CVS committal Author : andrew Host : Project : linux-ha Module : tools Dir : linux-ha/tools Modified Files: attrd_updater.c Log Message: Output formatting =================================================================== RCS file: /home/cvs/linux-ha/linux-ha/tools/attrd_updater.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- attrd_updater.c 9 Apr 2006 17:05:26 -0000 1.3 +++ attrd_updater.c 1 Jun 2006 08:43:37 -0000 1.4 @@ -1,4 +1,4 @@ -/* $Id: attrd_updater.c,v 1.3 2006/04/09 17:05:26 andrew Exp $ */ +/* $Id: attrd_updater.c,v 1.4 2006/06/01 08:43:37 andrew Exp $ */ /* * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]> * @@ -108,7 +108,7 @@ (void*)process_attrd_message, &attrd); if(attrd == NULL) { - fprintf(stderr, "Could not connect to "T_ATTRD); + fprintf(stderr, "Could not connect to "T_ATTRD"\n"); return 1; } @@ -131,7 +131,7 @@ } if(send_ipc_message(attrd, update) == FALSE) { - fprintf(stderr, "Could not send update"); + fprintf(stderr, "Could not send update\n"); return 1; } return 0; ------------------------------ _______________________________________________ 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 1 *******************************************