From a0c8edaabefeab6f33cfb94ad4dbc9bd9c71a602 Mon Sep 17 00:00:00 2001 From: liang_-123 Date: Tue, 15 Sep 2020 16:16:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9Invalid=20argument=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/manager/om/script/gs_checkos | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/manager/om/script/gs_checkos b/src/manager/om/script/gs_checkos index fcd6d266a..6002c42c8 100644 --- a/src/manager/om/script/gs_checkos +++ b/src/manager/om/script/gs_checkos @@ -426,6 +426,7 @@ def doCheckOS(itemNumber): """ if (itemNumber == 'A1'): checkOSVersion() + checkOSConfig() elif (itemNumber == 'A2'): checkKernelVersion() elif (itemNumber == 'A3'): @@ -1408,6 +1409,26 @@ def getTmpFile(): return tmpFile +def checkOSConfig(): + ''' + function : Check the parameters in logind.conf + ''' + g_logger.debug("Checking OS configuration.") + try: + cmd = "cat /etc/systemd/logind.conf | " + \ + "grep RemoveIPC | grep -o -E '(yes|no)' | tail -1" + (status, output, outputMap) = getCmdOutput(cmd) + for hostName in outputMap: + result = outputMap[hostName] + if (result.strip() == "yes"): + g_logger.logExit("[%s]: \n" % hostName + + ErrorCode.GAUSS_516["GAUSS_51632"] % cmd + + " Error: \n You should set RemoveIPC=no " + \ + "in /etc/systemd/logind.conf, "+ \ + "and restart the server") + except Exception as e: + g_logger.debug(str(e)) + g_logger.debug("Successfully checked OS config.") def main(): """ main function