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: linux-ha by msoffen from
([email protected])
2. Linux-HA CVS: linux-ha by andrew from
([email protected])
3. Linux-HA CVS: crm by andrew from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Tue, 2 May 2006 14:44:36 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: linux-ha by msoffen from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : msoffen
Host :
Module : linux-ha
Dir : linux-ha
Modified Files:
bootstrap
Log Message:
Changed back to previous version. Added Darwin check to Linux check.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/bootstrap,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- bootstrap 2 May 2006 10:09:13 -0000 1.25
+++ bootstrap 2 May 2006 20:44:35 -0000 1.26
@@ -29,32 +29,15 @@
return 0;
fi
- cmd=`which -s $1`
- if [ ! -f "$cmd" ]; then
- return 1
- fi
-
+ cmd=""
arch=`uname -s`
- # On some systems we have to make do with the presence of the command
- if [ "$arch" != "Linux" -a "$arch" != "Darwin" ]; then
- return 0;
- fi
-
- # The GNU standard is --version
- if
- $cmd --version </dev/null >/dev/null 2>&1
- then
- return 0
- fi
-
- # Fall back to -V
- if
- $cmd -V </dev/null >/dev/null 2>&1
+ if [ "$arch" = "Linux" -a "$arch" = "Darwin" ]
then
- return 0
+ cmd="$1 --version </dev/null >/dev/null 2>&1"
+ else
+ cmd="which -s $1"
fi
- return 1
}
srcdir=`dirname $0`
@@ -93,8 +76,9 @@
URL=$gnu/$pkg/
for command in autoconf autoconf213 autoconf253 autoconf259
do
+ testProgram $command
if
- testProgram $command
+ $cmd >/dev/null 2>&1
then
: OK $pkg is installed
autoconf=$command
@@ -127,8 +111,9 @@
URL=$gnu/$pkg/
for command in automake automake14 automake15 automake19
do
+ testProgram $command
if
- testProgram $command
+ $cmd >/dev/null 2>&1
then
: OK $pkg is installed
automake=$command
@@ -157,8 +142,9 @@
for command in libtool libtool14 libtool15 glibtool
do
URL=$gnu/$pkg/
+ testProgram $command
if
- testProgram $command
+ $cmd >/dev/null 2>&1
then
: OK $pkg is installed
libtool=$command
------------------------------
Message: 2
Date: Wed, 3 May 2006 01:54:39 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: linux-ha by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Module : linux-ha
Dir : linux-ha
Modified Files:
bootstrap
Log Message:
Have testProgram() return a simple yes/no
Make sure the call to which is in an if-block to avoid trap being invoked
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/bootstrap,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- bootstrap 2 May 2006 20:44:35 -0000 1.26
+++ bootstrap 3 May 2006 07:54:38 -0000 1.27
@@ -24,20 +24,46 @@
testProgram()
{
- if [ -z "$1" ]
- then
- return 0;
+ cmd=$1
+ WHICH_OPTS="-s"
+
+ if [ -z "$cmd" ]; then
+ return 1;
fi
- cmd=""
arch=`uname -s`
- if [ "$arch" = "Linux" -a "$arch" = "Darwin" ]
+ if [ "$arch" = "Darwin" ]; then
+ WHICH_OPTS=""
+ fi
+
+ # Make sure the which is in an if-block... on some platforms it throws
exceptions
+ #
+ # The ERR trap is not executed if the failed command is part
+ # of an until or while loop, part of an if statement, part of a &&
+ # or || list, or if the command's return value is being inverted
+ # via !.
+ if
+ ! which $WHICH_OPTS $cmd </dev/null >/dev/null 2>&1
+ then
+ return 1
+ fi
+
+ # The GNU standard is --version
+ if
+ $cmd --version </dev/null >/dev/null 2>&1
+ then
+ return 0
+ fi
+
+ # Maybe it suppports -V instead
+ if
+ $cmd -V </dev/null >/dev/null 2>&1
then
- cmd="$1 --version </dev/null >/dev/null 2>&1"
- else
- cmd="which -s $1"
+ return 0
fi
+ # Nope, the program seems broken
+ return 1
}
srcdir=`dirname $0`
@@ -76,9 +102,8 @@
URL=$gnu/$pkg/
for command in autoconf autoconf213 autoconf253 autoconf259
do
- testProgram $command
if
- $cmd >/dev/null 2>&1
+ testProgram $command
then
: OK $pkg is installed
autoconf=$command
@@ -111,9 +136,8 @@
URL=$gnu/$pkg/
for command in automake automake14 automake15 automake19
do
- testProgram $command
if
- $cmd >/dev/null 2>&1
+ testProgram $command
then
: OK $pkg is installed
automake=$command
@@ -142,9 +166,8 @@
for command in libtool libtool14 libtool15 glibtool
do
URL=$gnu/$pkg/
- testProgram $command
if
- $cmd >/dev/null 2>&1
+ testProgram $command
then
: OK $pkg is installed
libtool=$command
------------------------------
Message: 3
Date: Wed, 3 May 2006 02:58:09 -0600 (MDT)
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/admin
Modified Files:
crm_resource.c
Log Message:
Always use the correct form of the resource name regardless of what version
was specified with -r
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/admin/crm_resource.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- crm_resource.c 20 Apr 2006 11:32:03 -0000 1.21
+++ crm_resource.c 3 May 2006 08:58:09 -0000 1.22
@@ -1,4 +1,4 @@
-/* $Id: crm_resource.c,v 1.21 2006/04/20 11:32:03 andrew Exp $ */
+/* $Id: crm_resource.c,v 1.22 2006/05/03 08:58:09 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
@@ -615,7 +615,8 @@
if(rsc_cmd == 'L' || rsc_cmd == 'W' || rsc_cmd == 'D' || rsc_cmd == 'Q'
|| rsc_cmd == 'p' || rsc_cmd == 'M' || rsc_cmd == 'U'
- || rsc_cmd == 'G' || rsc_cmd == 'g') {
+ || rsc_cmd == 'C' || rsc_cmd == 'G' || rsc_cmd == 'g') {
+ resource_t *rsc = NULL;
cib_conn = cib_new();
rc = cib_conn->cmds->signon(
cib_conn, crm_system_name, cib_command_synchronous);
@@ -624,17 +625,23 @@
cib_error2string(rc));
return rc;
}
+
+ cib_xml_copy = get_cib_copy(cib_conn);
+
set_working_set_defaults(&data_set);
+ data_set.input = cib_xml_copy;
+ data_set.now = new_ha_date(TRUE);
- if(rsc_cmd != 'D' && rsc_cmd != 'U') {
- cib_xml_copy = get_cib_copy(cib_conn);
- data_set.input = cib_xml_copy;
- data_set.now = new_ha_date(TRUE);
- stage0(&data_set);
+ stage0(&data_set);
+ rsc = pe_find_resource(data_set.resources, rsc_id);
+ if(rsc != NULL) {
+ rsc_id = rsc->id;
+ } else {
+ rc = cib_NOTEXISTS;
}
- } else if(rsc_cmd == 'R' || rsc_cmd == 'D'
- || rsc_cmd == 'C' || rsc_cmd == 'P') {
+ }
+ if(rsc_cmd == 'R' || rsc_cmd == 'C' || rsc_cmd == 'P') {
GCHSource *src = NULL;
src = init_client_ipc_comms(CRM_SYSTEM_CRMD, crmd_msg_callback,
NULL, &crmd_channel);
@@ -650,11 +657,15 @@
set_IPC_Channel_dnotify(src, resource_ipc_connection_destroy);
}
-
if(rsc_cmd == 'L') {
+ rc = cib_ok;
do_find_resource_list(&data_set);
+ } else if(rc == cib_NOTEXISTS) {
+ fprintf(stderr, "Resource %s not found: %s\n",
+ crm_str(rsc_id), cib_error2string(rc));
+
} else if(rsc_cmd == 'W') {
CRM_DEV_ASSERT(rsc_id != NULL);
rc = do_find_resource(rsc_id, &data_set);
@@ -754,10 +765,15 @@
free_xml(msg_data);
} else if(rsc_cmd == 'C') {
- delete_lrm_rsc(crmd_channel, host_uname, rsc_id);
- sleep(10);
- refresh_lrm(crmd_channel, host_uname);
-
+ resource_t *rsc = pe_find_resource(data_set.resources, rsc_id);
+ if(rsc != NULL) {
+ delete_lrm_rsc(crmd_channel, host_uname,
rsc->graph_name);
+ sleep(10);
+ refresh_lrm(crmd_channel, host_uname);
+ } else {
+ rc = cib_NOTEXISTS;
+ }
+
} else {
fprintf(stderr, "Unknown command: %c\n", rsc_cmd);
}
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 30, Issue 6
*******************************************