------------------------------------------------------------
revno: 775
revision-id:[EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge.stable
timestamp: Mon 2008-01-21 12:46:11 +1100
message:
  merged 60.nfs changes from ronnie
modified:
  config/events.d/60.nfs         nfs-20070601141008-hy3h4qgbk1jd2jci-1
=== modified file 'config/events.d/60.nfs'
--- a/config/events.d/60.nfs    2008-01-16 11:06:44 +0000
+++ b/config/events.d/60.nfs    2008-01-21 01:46:11 +0000
@@ -18,6 +18,8 @@
        /bin/mkdir -p $CTDB_BASE/state/statd/ip
        /bin/mkdir -p $STATD_SHARED_DIRECTORY
 
+       /bin/rm -f $CTDB_BASE/state/statd/statd.restart >/dev/null 2>/dev/null
+
        # make sure nfs is stopped before we start it, or it may get a bind 
error
        service nfs stop > /dev/null 2>&1
        service nfslock stop > /dev/null 2>&1
@@ -68,6 +70,31 @@
        ;;
 
       monitor)
+       # check that statd responds to rpc requests
+       # if statd is not running we try to restart it once and wait
+       # for the next monitoring event to verify if it is running or not
+       # if it still fails we fail and mark the node as UNHEALTHY
+       if [ -f $CTDB_BASE/state/statd/statd.restart ]; then
+               # statd was restarted, see if it came up ok
+               rpcinfo -u localhost 100024 1 > /dev/null || {
+                       echo "ERROR: Failed to restart STATD"
+                       exit 1
+               }
+               echo "STATD successfully restarted."
+               /bin/rm -f $CTDB_BASE/state/statd/statd.restart
+       else
+               rpcinfo -u localhost 100024 1 > /dev/null || {
+                       RPCSTATDOPTS=""
+                       [ -n "$STATD_HOSTNAME" ] && RPCSTATDOPTS="$RPCSTATDOPTS 
-n $STATD_HOSTNAME"
+                       [ -n "$STATD_PORT" ] && RPCSTATDOPTS="$RPCSTATDOPTS -p 
$STATD_PORT"
+                       [ -n "$STATD_OUTGOING_PORT" ] && 
RPCSTATDOPTS="$RPCSTATDOPTS -o $STATD_OUTGOING_PORT"
+                       rpc.statd $RPCSTATDOPTS 
+                       echo "ERROR: STATD is not responding. Trying to restart 
it. [rpc.statd $RPCSTATDOPTS]"
+                       touch $CTDB_BASE/state/statd/statd.restart
+               }
+       fi
+
+
        # check that NFS responds to rpc requests
        ctdb_check_rpc "NFS" 100003 3
 
@@ -76,7 +103,6 @@
        ctdb_check_directories "nfs" $nfs_dirs
 
        # check that lockd responds to rpc requests
-       ctdb_check_rpc "statd" 100024 1
        ctdb_check_rpc "lockd" 100021 1
        ctdb_check_directories "statd" $STATD_SHARED_DIRECTORY
 

Reply via email to