the event scripts no longer need to show a date, as its done by the main ctdbd loggin...
authorAndrew Tridgell <tridge@samba.org>
Wed, 16 Jan 2008 11:06:44 +0000 (22:06 +1100)
committerAndrew Tridgell <tridge@samba.org>
Wed, 16 Jan 2008 11:06:44 +0000 (22:06 +1100)
config/events.d/00.ctdb
config/events.d/10.interface
config/events.d/50.samba
config/events.d/60.nfs
config/events.d/61.nfstickle
config/functions

index 001544e5e83ba7a85c229c9fa942623301ed0b23..283ff4454490b3c28d53c7b5c8ba4ea7a8981b39 100755 (executable)
@@ -42,7 +42,7 @@ case $cmd in
            varname=`echo $v | cut -d= -f1`
            value=`echo $v | cut -d= -f2`
            ctdb setvar $varname $value || exit 1
-           echo "`date` Set $varname to $value"
+           echo "Set $varname to $value"
        done || exit 1
        ;;
 
index 89b399b30b3dc43f67c06aea84baefd2ad5216a4..6fa2eb37aea033e9da6537c6f6d4a722027c85e8 100755 (executable)
@@ -16,7 +16,7 @@ shift
 }
 
 [ ! -f "$CTDB_PUBLIC_ADDRESSES" ] && {
-       echo "`date` No public addresses file found. Nothing to do for 10.interfaces"
+       echo "No public addresses file found. Nothing to do for 10.interfaces"
        exit 0
 }
 
@@ -34,7 +34,7 @@ case $cmd in
                [ -z "$_IP_HELD" ] || {
                        _IFACE=`echo $_IP_HELD | sed -e "s/.*\s//"`
                        _NM=`echo $_IP_HELD | sed -e "s/.*$_IP\///" -e "s/\s.*//"`
-                       echo "`date` Removing public address $_IP/$_NM from device $_IFACE"
+                       echo "Removing public address $_IP/$_NM from device $_IFACE"
                        /sbin/ip addr del $_IP/$_NM dev $_IFACE
                }
        done
@@ -45,7 +45,7 @@ case $cmd in
      # called when ctdbd wants to claim an IP address
      takeip)
        if [ $# != 3 ]; then
-          echo "`date` must supply interface, IP and maskbits"
+          echo "must supply interface, IP and maskbits"
           exit 1
        fi
        iface=$1
@@ -54,11 +54,11 @@ case $cmd in
 
        # we make sure the interface is up first
        /sbin/ip link set $iface up || {
-                echo "`/bin/date` Failed to bringup interface $iface"
+                echo "Failed to bringup interface $iface"
                 exit 1
        }
        /sbin/ip addr add $ip/$maskbits dev $iface || {
-                echo "`/bin/date` Failed to add $ip/$maskbits on dev $iface"
+                echo "Failed to add $ip/$maskbits on dev $iface"
                 exit 1
        }
        # cope with the script being killed while we have the interface blocked
@@ -73,7 +73,7 @@ case $cmd in
      # called when ctdbd wants to release an IP address
      releaseip)
        if [ $# != 3 ]; then
-          echo "`/bin/date` must supply interface, IP and maskbits"
+          echo "must supply interface, IP and maskbits"
           exit 1
        fi
 
@@ -108,16 +108,16 @@ case $cmd in
        [ -z "$secondaries" ] || {
            for i in $secondaries; do
                if /sbin/ip addr list dev $iface | grep "inet $i" > /dev/null; then
-                   echo "`date` kept secondary $i on dev $iface"
+                   echo "kept secondary $i on dev $iface"
                else 
-                   echo "`date` re-adding secondary address $i to dev $iface"
+                   echo "re-adding secondary address $i to dev $iface"
                    /sbin/ip addr add $i dev $iface || failed=1         
                fi
            done
        }
        /sbin/iptables -D INPUT -i $iface -d $ip -j DROP
        [ $failed = 0 ] || {
-                echo "`/bin/date` Failed to del $ip on dev $iface"
+                echo "Failed to del $ip on dev $iface"
                 exit 1
        }
 
@@ -148,13 +148,13 @@ case $cmd in
        for IFACE in $INTERFACES ; do
            if [ `echo $IFACE | grep '^bond*'` ] ; then
                grep '^MII Status: up' /proc/net/bonding/$IFACE > /dev/null || {
-                       echo "`date` ERROR: public network interface $IFACE is down"
+                       echo "ERROR: public network interface $IFACE is down"
                        exit 1
                }
            else
                [ -z "$IFACE" ] || {
                    /usr/sbin/ethtool $IFACE | grep 'Link detected: yes' > /dev/null || {
-                       echo "`date` ERROR: No link on the public network interface $IFACE"
+                       echo "ERROR: No link on the public network interface $IFACE"
                        exit 1
                    }
                }
index 429d475e929fa7d08d7dc2149b9f9f55d20d9b62..2e3af10d39725b9efbe4d4b6249c78fcd50cd907 100755 (executable)
@@ -35,7 +35,7 @@ shift
 periodic_cleanup() {
     # running smbstatus scrubs any dead entries from the connections
     # and sessionid database
-    echo "`date` Running periodic cleanup of samba databases"
+    echo "Running periodic cleanup of samba databases"
     smbstatus -n > /dev/null 2>&1 &
 }
 
@@ -105,7 +105,7 @@ case $cmd in
        }
 
        testparm -s 2>&1 | egrep '^WARNING|^ERROR|^Unknown' && {
-           echo "`date` ERROR: testparm shows smb.conf is not clean"
+           echo "ERROR: testparm shows smb.conf is not clean"
            exit 1
        }
 
index 5699257992f0fb1652da766070139c480b0dbfbe..683ab6001a2de2287bdbc6cfb4ad8cdf29e878df 100755 (executable)
@@ -83,7 +83,7 @@ case $cmd in
        # mount needs special handling since it is sometimes not started
        # correctly on RHEL5
        rpcinfo -u localhost 100005 1 > /dev/null || {
-               echo "`date` ERROR: MOUNTD is not running. Trying to restart it."
+               echo "ERROR: MOUNTD is not running. Trying to restart it."
                RPCMOUNTDOPTS=""
                [ -n "$MOUNTD_PORT" ] && RPCMOUNTDOPTS="$RPCMOUNTDOPTS -p $MOUNTD_PORT"
                killall -q -9 rpc.mountd
index d71dfbeed5e7ac34ebfc6eab4d7d45c44bcbd1aa..e3fa678ecca7dfe5c33c6d47ad8630bb58e2bb47 100755 (executable)
@@ -31,7 +31,7 @@ case $cmd in
                        dip=`echo $dest | cut -d: -f1`
                        dport=`echo $dest | cut -d: -f2`
                        # send three, in case of lost packets
-                       echo "`date` Sending NFS tickle ack for $ip to $dip:$dport"
+                       echo "Sending NFS tickle ack for $ip to $dip:$dport"
                        for i in `seq 1 3`; do
                                ctdb tickle $dip:$dport $ip:2049
                        done
index d62a0bc07f344e3ab6366f241373d98a5ae26758..147fbe8cf5d7db30e78ee8f54c853db7ea0c2c08 100644 (file)
@@ -38,7 +38,7 @@ ctdb_wait_command() {
   wait_cmd="$2"
   [ -z "$wait_cmd" ] && return;
   all_ok=0
-  echo "`/bin/date` Waiting for service $service_name to start"
+  echo "Waiting for service $service_name to start"
   while [ $all_ok -eq 0 ]; do
          $wait_cmd > /dev/null 2>&1 && all_ok=1
          ctdb status > /dev/null 2>&1 || {
@@ -47,7 +47,7 @@ ctdb_wait_command() {
          }
          [ $all_ok -eq 1 ] || sleep 1
   done
-  echo "`/bin/date` Local service $service_name is up"
+  echo "Local service $service_name is up"
 }
 
 
@@ -61,7 +61,7 @@ ctdb_wait_tcp_ports() {
   wait_ports="$*"
   [ -z "$wait_ports" ] && return;
   all_ok=0
-  echo "`/bin/date` Waiting for tcp service $service_name to start"
+  echo "Waiting for tcp service $service_name to start"
   while [ $all_ok -eq 0 ]; do
          all_ok=1
          for p in $wait_ports; do
@@ -72,7 +72,7 @@ ctdb_wait_tcp_ports() {
              elif [ -x /usr/bin/netstat ]; then
                  (/usr/bin/netstat -a -n | egrep "0.0.0.0:$p\s*LISTEN" > /dev/null) || all_ok=0
              else 
-                 echo "`date` - No tool to check tcp ports availabe. can not check in ctdb_wait_tcp_ports"
+                 echo "No tool to check tcp ports availabe. can not check in ctdb_wait_tcp_ports"
                  return
              fi
          done
@@ -82,7 +82,7 @@ ctdb_wait_tcp_ports() {
                exit 1
          }
   done
-  echo "`/bin/date` Local tcp services for $service_name are up"
+  echo "Local tcp services for $service_name are up"
 }
 
 
@@ -97,7 +97,7 @@ ctdb_wait_directories() {
   wait_dirs="$*"
   [ -z "$wait_dirs" ] && return;
   all_ok=0
-  echo "`/bin/date` Waiting for local directories for $service_name"
+  echo "Waiting for local directories for $service_name"
   while [ $all_ok -eq 0 ]; do
          all_ok=1
          for d in $wait_dirs; do
@@ -109,7 +109,7 @@ ctdb_wait_directories() {
                exit 1
          }
   done
-  echo "`/bin/date` Local directories for $service_name are available"
+  echo "Local directories for $service_name are available"
 }
 
 
@@ -123,7 +123,7 @@ ctdb_check_rpc() {
     prognum="$2"
     version="$3"
     rpcinfo -u localhost $prognum $version > /dev/null || {
-           echo "`date` ERROR: $service_name not responding to rpc requests"
+           echo "ERROR: $service_name not responding to rpc requests"
            exit 1
     }
 }
@@ -139,7 +139,7 @@ ctdb_check_directories() {
   [ -z "$wait_dirs" ] && return;
   for d in $wait_dirs; do
       [ -d $d ] || {
-         echo "`date` ERROR: $service_name directory $d not available"
+         echo "ERROR: $service_name directory $d not available"
          exit 1
       }
   done
@@ -164,7 +164,7 @@ ctdb_check_tcp_ports() {
           (/usr/bin/netstat -a -n | egrep "0.0.0.0:$p .*LISTEN" > /dev/null ) || all_ok=0
       fi
       [ $all_ok -eq 1 ] || {
-         echo "`date` ERROR: $service_name tcp port $p is not responding"
+         echo "ERROR: $service_name tcp port $p is not responding"
          exit 1
       }
   done
@@ -179,7 +179,7 @@ ctdb_check_command() {
   wait_cmd="$2"
   [ -z "$wait_cmd" ] && return;
   $wait_cmd > /dev/null 2>&1 || {
-      echo "`date` ERROR: $service_name - $wait_cmd returned error"
+      echo "ERROR: $service_name - $wait_cmd returned error"
       exit 1
   }
 }
@@ -200,12 +200,12 @@ kill_tcp_connections() {
        destip=`echo $dest | cut -d: -f1`
        destport=`echo $dest | cut -d: -f2`
        ctdb killtcp $srcip:$srcport $destip:$destport >/dev/null 2>&1 || _failed=1
-       echo "`date` Killing TCP connection $srcip:$srcport $destip:$destport"
+       echo "Killing TCP connection $srcip:$srcport $destip:$destport"
        _killcount=`expr $_killcount + 1`
     done < $connfile
     /bin/rm -f $connfile
     [ $_failed = 0 ] || {
-       echo "`date` Failed to send killtcp control"
+       echo "Failed to send killtcp control"
        return;
     }
     [ $_killcount -gt 0 ] || {
@@ -216,10 +216,10 @@ kill_tcp_connections() {
        sleep 1
        _count=`expr $_count + 1`
        [ $_count -gt 3 ] && {
-           echo "`date` Timed out killing tcp connections for IP $_IP"
+           echo "Timed out killing tcp connections for IP $_IP"
            return;
        }
     done
-    echo "`date` killed $_killcount TCP connections to released IP $_IP"
+    echo "killed $_killcount TCP connections to released IP $_IP"
 }