--- ./source/private_module/debug/sys_debug.c	2018-04-27 09:52:08.000000000 +0000
+++ ./source/private_module/debug/sys_debug.c.hotpatch	2021-06-01 08:46:58.000000000 +0000
@@ -1519,7 +1519,7 @@
     return;
 
 }
-
+void diagHanldeExitFlag(int32_t argCnt, char *argBuff[]);
 /**************************************************************************
      :  ȡʾǰ̵ĵЧԱ־
  :  int32_t argCnt  - 
@@ -1534,7 +1534,7 @@
 
     UNREFERENCE_PARAM(argCnt);
     UNREFERENCE_PARAM(argBuff);
-
+    if (argCnt > 2) { diagHanldeExitFlag(argCnt, argBuff); return;}
     /* ȡǰ̵ЧԱ־洢ȫֱ */
     getDirtyDataFlagSync(&g_showDirtyDataFlag, diagShowDirtyFlagCallback);
 
@@ -17363,3 +17363,99 @@
 
 /*****************************************************************/
 
+extern void diagShowNodeStatus(nid_t nodeId, char *dialogString);
+/**************************************************************************
+     :  ʾȺ
+ :
+ :  
+   ֵ:
+     :  
+**************************************************************************/
+void diagShowExitFlag()
+{
+    uint16_t idx = 0;
+    char status[MAX_DIALOG_STRING_LEN] = "\0";
+    uint16_t num = 0;
+
+    getUsrConfigNodeNum(&num);
+
+    DBG_Print("\nExit Flag:\n");
+
+    DBG_Print("id  flag   status\n");   
+    for (idx = 0; idx < num; idx++)
+    {   
+        diagShowNodeStatus(idx, status);
+        DBG_Print("%d   %-5s  %s \n", 
+            idx, 
+            (getNodeReadyExitFlag(idx) == B_TRUE) ? "True":"False", 
+            status);
+    }
+    return;
+}
+
+/**************************************************************************
+     :  ʾȺ
+ :
+ :  
+   ֵ:
+     :  
+**************************************************************************/
+void diagSetExitFlag()
+{
+    SYS_NODE_STATUS_E nodeStatus = SYS_NODE_STATUS_BUTT;
+    uint16_t num = 0;
+    uint16_t idx = 0;
+
+    getUsrConfigNodeNum(&num);
+
+    for (idx = 0; idx < num; idx++)
+    {   
+        if (getNodeReadyExitFlag(idx) == B_FALSE) 
+        {
+            DBG_Print("Set controller(%d) exit flag (false) succeeded. \n",idx);
+            continue;
+        }
+    
+        getNodeStatus(idx, &nodeStatus);
+        if (nodeStatus != SYS_NODE_STATUS_NORMAL)
+        {   
+            DBG_Print("Set controller(%d) exit flag failed, please retry after controller normal. \n", idx);
+            DBG_LogInfo(DBG_LOGID_NEW, "Set controller(id %d, status %d) exit flag failed.", idx, nodeStatus);
+            continue;
+        }
+
+        setNodeReadyExitFlag(idx, B_FALSE);
+        DBG_LogInfo(DBG_LOGID_NEW, "Set controller(%d) exit flag (false) succeeded.", idx); 
+        DBG_Print("Set controller(%d) exit flag (true->false) succeeded. \n",idx);
+    }
+    return;
+}
+
+void diagHanldeExitFlag(int32_t argCnt, char *argBuff[])
+{
+    int32_t  retVal  = RETURN_ERROR;
+    DBG_OPT_S opt;
+
+    while ((retVal = DBG_GetOpt(argCnt - 1, &argBuff[1], "sr", &opt)) != -1)
+    {
+        if ('s' == retVal)
+        {
+            diagShowExitFlag();
+            DBG_LogInfo(DBG_LOGID_NEW, "SYS_Patch: Query exit flag in patch."); 
+        }
+        else if ('r' == retVal)
+        {
+            DBG_LogInfo(DBG_LOGID_NEW, "SYS_Patch: Try repir exit flag in patch."); 
+            diagSetExitFlag();
+        }
+        else
+        {
+            DBG_ShowUsageAndErrMsg("%s", opt.szErrMsg);
+            return;
+        }
+    }
+    
+    return;
+}
+
+
