X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fscripts%2Flustre;h=919efb07115952c809a884b9e057d6db59d58d55;hb=80a2ff7137d3504e5672c6a68561d4ae8d5a28e3;hp=1c27a0a5ce8f6b2d3b65ef3a880384966bd5e5db;hpb=f625f670afbe954030ff81f0f8522137d6cdd335;p=fs%2Flustre-release.git diff --git a/lustre/scripts/lustre b/lustre/scripts/lustre index 1c27a0a..919efb0 100644 --- a/lustre/scripts/lustre +++ b/lustre/scripts/lustre @@ -595,6 +595,7 @@ stop_lustre_services () # General lustre health check - not device specific. health_check () { + old_nullglob="`shopt -p nullglob`" shopt -u nullglob @@ -617,29 +618,32 @@ health_check () fi # check for either a server or a client filesystem - MDT="" - OST="" - LLITE="" + local MGT="" + local MDT="" + local OST="" + local LLITE="" + + ! lctl get_param -n mgs.MGS.* >/dev/null 2>&1 || MGT="YES" - VAR=$(lctl get_param -n mdt.*.recovery_status 2>&1) + VAR=$(lctl get_param -n mdt.*.recovery_status 2>&1 | grep '^status:' ) if [ $? = 0 ] ; then - MDT="YES" + MDT=$VAR fi - VAR=$(lctl get_param -n obdfilter.*.recovery_status 2>&1) + VAR=$(lctl get_param -n obdfilter.*.recovery_status 2>&1 | grep '^status:') if [ $? = 0 ] ; then - OST="YES" - fi + OST=$VAR + fi - VAR=$(lctl get_param -n llite.fs* 2>&1) + VAR=$(lctl get_param -n llite.fs* 2>&1) if [ $? = 0 ] ; then - LLITE="YES" - fi + LLITE="YES" + fi - if [ "$MDT" -o "$OST" -o "$LLITE" ]; then - STATE="running" - RETVAL=0 - fi + if [ "$MGT" -o "$MDT" -o "$OST" -o "$LLITE" ]; then + STATE="running" + RETVAL=0 + fi else # check if this is a router if [[ "$(lctl get_param -n routes)" =~ "Routing enabled" ]]; then @@ -649,7 +653,7 @@ health_check () fi # check for server disconnections - VAR=$(lctl get_param -n *c.*.*server_uuid 2>&1) + VAR=$(lctl get_param -n *c.*.*server_uuid 2>&1) if [ $? = 0 ] ; then DISCON="$(echo $VAR | grep -v FULL)" if [ -n "$DISCON" ] ; then @@ -659,7 +663,7 @@ health_check () fi # check for servers in recovery - if [ -n "$MDT$OST" ] && grep -q RECOV $MDT $OST ; then + if [ -n "$MDT$OST" ] && echo $MDT $OST | grep -q RECOV ; then STATE="recovery" RETVAL=0 fi