Whamcloud - gitweb
LU-9213 scripts: check MGT status in lustre init script 95/25995/3
authorJian Yu <jian.yu@intel.com>
Wed, 15 Mar 2017 06:44:13 +0000 (23:44 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 26 Mar 2017 06:51:03 +0000 (06:51 +0000)
This patch fixes health_check() in lustre init script to
account for the status of MGT on a dedicated node.

Test-Parameters: trivial

Change-Id: Ifdf2e4a1002e870c25925b6e7fce82b132cc24f2
Signed-off-by: Jian Yu <jian.yu@intel.com>
Reviewed-on: https://review.whamcloud.com/25995
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/scripts/lustre

index 0f8f082..919efb0 100644 (file)
@@ -618,9 +618,12 @@ health_check ()
                fi
 
                # check for either a server or a client filesystem
                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 | grep '^status:'  )
                if [ $? = 0 ] ; then
 
                VAR=$(lctl get_param -n mdt.*.recovery_status 2>&1 | grep '^status:'  )
                if [ $? = 0 ] ; then
@@ -629,18 +632,18 @@ health_check ()
 
                VAR=$(lctl get_param -n obdfilter.*.recovery_status 2>&1 | grep '^status:')
                if [ $? = 0 ] ; then
 
                VAR=$(lctl get_param -n obdfilter.*.recovery_status 2>&1 | grep '^status:')
                if [ $? = 0 ] ; then
-                        OST=$VAR
-                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
                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
        else
                # check if this is a router
                if [[ "$(lctl get_param -n routes)" =~ "Routing enabled" ]]; then
@@ -650,7 +653,7 @@ health_check ()
        fi
 
        # check for server disconnections
        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
        if [ $? = 0 ] ; then
                DISCON="$(echo $VAR | grep -v FULL)"
                if [ -n "$DISCON" ] ; then