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


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

Message: 1
Date: Sun, 13 Nov 2005 10:00:03 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: resources by davidlee from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : davidlee
Host    : 
Project : linux-ha
Module  : resources

Dir     : linux-ha/resources/OCF


Modified Files:
        ocf-shellfuncs.in 


Log Message:
simplify the character testing
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/resources/OCF/ocf-shellfuncs.in,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- ocf-shellfuncs.in   12 Nov 2005 14:28:17 -0000      1.21
+++ ocf-shellfuncs.in   13 Nov 2005 17:00:02 -0000      1.22
@@ -1,5 +1,5 @@
 #
-#      $Id: ocf-shellfuncs.in,v 1.21 2005/11/12 14:28:17 xunsun Exp $
+#      $Id: ocf-shellfuncs.in,v 1.22 2005/11/13 17:00:02 davidlee Exp $
 #
 #      Common helper functions for the OCF Resource Agents supplied by
 #      heartbeat.
@@ -45,19 +45,42 @@
        [ $1 = "uid=0(root)" ]
 }
 
+# Portability comments:
+# o The following rely on Bourne "sh" pattern-matching, which is usually
+#   that for filename generation (note: not regexp).
+# o The "*) true ;;" clause is probably unnecessary, but is included
+#   here for completeness.
+# o The negation in the pattern uses "!".  This seems to be common
+#   across many OSes (whereas the alternative "^" fails on some).
+# o If an OS is encountered where this negation fails, then a possible
+#   alternative would be to replace the function contents by (e.g.):
+#      [ -z "`echo $1 | tr -d '[0-9]'`" ]
+#
 ocf_is_decimal() {
-        # test: delete all decimal digits: result should be zero-length
-        [ -z "`echo $1 | tr -d '[0-9]'`" ]
+       case "$1" in
+       ""|*[!0-9]*)    # empty, or at least one non-decimal
+               false ;;
+       *)
+               true ;;
+       esac
 }
 
 ocf_is_hex() {
-        # test: delete all hex digits: result should be zero-length
-        [ -z "`echo $1 | tr -d '[0-9a-fA-F]'`" ]
+       case "$1" in
+        ""|*[!0-9a-fA-F]*)     # empty, or at least one non-hex
+               false ;;
+       *)
+               true ;;
+       esac
 }
 
 ocf_is_octal() {
-        # test: delete all octal digits: result should be zero-length
-        [ -z "`echo $1 | tr -d '[0-7]'`" ]
+       case "$1" in
+        ""|*[!0-7]*)   # empty, or at least one non-octal
+               false ;;
+       *)
+               true ;;
+       esac
 }
 
 __ocf_set_defaults() {




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

Message: 2
Date: Sun, 13 Nov 2005 10:16:43 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: resources by davidlee from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : davidlee
Host    : 
Project : linux-ha
Module  : resources

Dir     : linux-ha/resources/OCF


Modified Files:
        AudibleAlarm.in IPaddr.in Xinetd.in drbd.in 


Log Message:
Portability fixes; ensure "sh" is Bourne-compatible; avoid bash extensions
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/resources/OCF/AudibleAlarm.in,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- AudibleAlarm.in     12 Oct 2005 08:09:57 -0000      1.6
+++ AudibleAlarm.in     13 Nov 2005 17:16:43 -0000      1.7
@@ -30,7 +30,7 @@
        echo "Usage: $0 
{start|stop|restart|status|monitor|meta-data|validate-all}"
        echo "  The node list is an optional space delimited"
        echo "  list of hosts that should never sound the alarm."
-       echo "$Id: AudibleAlarm.in,v 1.6 2005/10/12 08:09:57 sunjd Exp $";
+       echo "$Id: AudibleAlarm.in,v 1.7 2005/11/13 17:16:43 davidlee Exp $";
 }
 
 meta_data() {
@@ -88,7 +88,9 @@
                #
                # To avoid issues when called by lrmd, redirect stdout->stderr.
        done &
-       if ! echo $! >  $PIDFILE; then
+       if echo $! >  $PIDFILE; then
+               :
+       else
                ocf_log info "$0: Could not write to pid file \"$PIDFILE\", 
bailing"
                kill $!
                return $OCF_ERR_GENERIC
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/resources/OCF/IPaddr.in,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -3 -r1.29 -r1.30
--- IPaddr.in   11 Nov 2005 16:15:02 -0000      1.29
+++ IPaddr.in   13 Nov 2005 17:16:43 -0000      1.30
@@ -810,7 +810,9 @@
 ip_monitor() {
   TIMEOUT=1 # seconds
 
-  if ! ip_status >/dev/null 2>&1; then
+  if ip_status >/dev/null 2>&1; then
+       :
+  else
        return $OCF_NOT_RUNNING
   fi
 
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/resources/OCF/Xinetd.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- Xinetd.in   3 Nov 2005 06:44:18 -0000       1.5
+++ Xinetd.in   13 Nov 2005 17:16:43 -0000      1.6
@@ -73,7 +73,9 @@
 
 hup_inetd () {
     if [ -s $XPIDFILE ]; then
-      if ! kill -HUP `cat $XPIDFILE`; then
+      if kill -HUP `cat $XPIDFILE`; then
+          :
+      else
           ocf_log err "Could not SigHUP xinetd superdaemon!"
           ocf_log err "perhaps we are booting after a system crash"
           exit $OCF_ERR_GENERIC
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/resources/OCF/drbd.in,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- drbd.in     11 Nov 2005 16:15:02 -0000      1.15
+++ drbd.in     13 Nov 2005 17:16:43 -0000      1.16
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#      $Id: drbd.in,v 1.15 2005/11/11 16:15:02 davidlee Exp $
+#      $Id: drbd.in,v 1.16 2005/11/13 17:16:43 davidlee Exp $
 #
 #       OCF Resource Agent compliant drbd resource script.
 #
@@ -449,7 +449,9 @@
            return $OCF_ERR_ARGS
        fi
        
-       if ! do_drbdadm dump $RESOURCE 2>/dev/null ; then
+       if do_drbdadm dump $RESOURCE 2>/dev/null ; then
+           :
+       else
            ocf_log err "Invalid configuration file $DRBDCONF"
            return $OCF_ERR_CONFIGURED
        fi




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

Message: 3
Date: Sun, 13 Nov 2005 10:16:43 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: resources by davidlee from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : davidlee
Host    : 
Project : linux-ha
Module  : resources

Dir     : linux-ha/resources/heartbeat


Modified Files:
        Xinetd.in 


Log Message:
Portability fixes; ensure "sh" is Bourne-compatible; avoid bash extensions
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/resources/heartbeat/Xinetd.in,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- Xinetd.in   3 Nov 2005 07:45:51 -0000       1.4
+++ Xinetd.in   13 Nov 2005 17:16:43 -0000      1.5
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $Id: Xinetd.in,v 1.4 2005/11/03 07:45:51 xunsun Exp $
+# $Id: Xinetd.in,v 1.5 2005/11/13 17:16:43 davidlee Exp $
 #
 # Description: wrapper of OCF RA Xinetd, based on original heartbeat RA.
 #              See OCF RA Xinetd for more information.
@@ -27,7 +27,7 @@
 fi 
 
 # Make sure the first parameter is a valid xinetd service name
-if ! [ -f $RCFILE ]; then
+if [ ! -f $RCFILE ]; then
     echo "ERROR:  Service descriptor $RCFILE not found!"
     xup_usage
     exit 1




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

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


End of Linux-ha-cvs Digest, Vol 24, Issue 49
********************************************

Reply via email to