代码拉取完成,页面将自动刷新
同步操作将从 openGauss/openGauss-OM 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 812edfeeb0e47f14dff2077ff5f8a69b4773eaef Mon Sep 17 00:00:00 2001
From: twx980514 <tanjinbo3@huawei.com>
Date: Tue, 6 Jul 2021 17:43:08 +0800
Subject: [PATCH] del sctp check
---
script/gs_check | 4 +-
script/gspylib/common/GaussLog.py | 2 +-
script/gspylib/etc/conf/check_list.conf | 11 ---
script/gspylib/etc/conf/check_list_dws.conf | 11 ---
.../inspection/config/check_list_V1R6C10.conf | 10 --
.../inspection/config/check_list_V1R7C00.conf | 11 ---
script/gspylib/inspection/config/items.xml | 38 +-------
script/gspylib/inspection/config/scene_inspect.xml | 2 -
script/gspylib/inspection/config/scene_install.xml | 2 -
script/gspylib/inspection/config/scene_upgrade.xml | 1 -
.../inspection/items/network/CheckNoCheckSum.py | 71 --------------
.../inspection/items/network/CheckUsedPort.py | 17 +---
.../inspection/items/os/CheckSctpService.py | 108 ---------------------
.../gspylib/inspection/items/os/CheckSysParams.py | 32 ++----
script/impl/preinstall/PreinstallImpl.py | 38 --------
script/local/LocalCheck.py | 21 +---
script/local/PreInstallUtility.py | 87 +----------------
17 files changed, 16 insertions(+), 450 deletions(-)
delete mode 100644 script/gspylib/inspection/items/network/CheckNoCheckSum.py
delete mode 100644 script/gspylib/inspection/items/os/CheckSctpService.py
diff --git a/script/gs_check b/script/gs_check
index 05d5625..0f29b31 100644
--- a/script/gs_check
+++ b/script/gs_check
@@ -93,13 +93,13 @@ DEFAULT_TIMEOUT = 1500
# because single clusters don't need to perform consistency checks and
# internal communication class checks
SINGLE_SKIP = ["CheckTimeZone", "CheckEncoding", "CheckKernelVer",
- "CheckNTPD", "CheckNoCheckSum", "CheckCpuCount",
+ "CheckNTPD", "CheckCpuCount",
"CheckMemInfo", "CheckDiskConfig",
"CheckUpVer", "CheckPgxcgroup", "CheckPing",
"CheckNetWorkDrop", "CheckNetSpeed"]
SETITEM_SKIP = ["CheckCPU", "CheckTimeZone", "CheckOSVer", "CheckNTPD",
- "CheckSshdService", "CheckNoCheckSum", "CheckEtcHosts",
+ "CheckSshdService", "CheckEtcHosts",
"CheckCpuCount", "CheckHyperThread", "CheckMemInfo",
"CheckKernelVer", "CheckEncoding", "CheckBootItems",
"CheckDropCache", "CheckFilehandle", "CheckKeyProAdj",
diff --git a/script/gspylib/common/GaussLog.py b/script/gspylib/common/GaussLog.py
index bdfecf1..31957d2 100644
--- a/script/gspylib/common/GaussLog.py
+++ b/script/gspylib/common/GaussLog.py
@@ -55,7 +55,7 @@ PREINSTALL_ACTION = ["prepare_path", "check_os_Version", "create_os_user",
"check_os_user", "create_cluster_paths",
"set_os_parameter", "set_finish_flag", "set_warning_env",
"prepare_user_cron_service", "prepare_user_sshd_service",
- "set_library", "set_sctp", "set_virtualIp",
+ "set_library", "set_virtualIp",
"clean_virtualIp", "check_hostname_mapping",
"init_gausslog", "check_envfile", "check_dir_owner",
"set_user_env", "set_tool_env", "gs_preinstall"]
diff --git a/script/gspylib/etc/conf/check_list.conf b/script/gspylib/etc/conf/check_list.conf
index deba792..77b7c60 100644
--- a/script/gspylib/etc/conf/check_list.conf
+++ b/script/gspylib/etc/conf/check_list.conf
@@ -10,14 +10,10 @@ net.ipv4.tcp_keepalive_time = 30
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_retries2 = 12
-net.sctp.addip_enable = 0
net.core.wmem_max = 21299200
net.core.rmem_max = 21299200
net.core.wmem_default = 21299200
net.core.rmem_default = 21299200
-net.sctp.sctp_mem = 94500000 915000000 927000000
-net.sctp.sctp_rmem = 8192 250000 16777216
-net.sctp.sctp_wmem = 8192 250000 16777216
kernel.sem = 250 6400000 1000 25600
net.ipv4.tcp_rmem = 8192 250000 16777216
net.ipv4.tcp_wmem = 8192 250000 16777216
@@ -33,8 +29,6 @@ kernel.shmmax = 18446744073709551615
# if parameter value is not equal to ths OS's value, print the waring, and not error
[SUGGEST:/etc/sysctl.conf]
-net.sctp.sndbuf_policy = 0
-net.sctp.rcvbuf_policy = 0
net.ipv4.ip_local_port_range = 26000 65535
net.ipv4.tcp_fin_timeout = 60
net.ipv4.tcp_sack = 1
@@ -42,13 +36,8 @@ net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_retries1 = 5
net.ipv4.tcp_syn_retries = 5
net.ipv4.tcp_synack_retries = 5
-net.sctp.path_max_retrans = 10
-net.sctp.max_init_retransmits = 10
-net.sctp.association_max_retrans = 10
-net.sctp.hb_interval = 30000
vm.extfrag_threshold = 500
vm.overcommit_ratio = 90
-SctpChecksumErrors = 0
# open file number, please set it to set '1000000'
[/etc/security/limits.conf]
diff --git a/script/gspylib/etc/conf/check_list_dws.conf b/script/gspylib/etc/conf/check_list_dws.conf
index a7f7b7c..a96f7e9 100644
--- a/script/gspylib/etc/conf/check_list_dws.conf
+++ b/script/gspylib/etc/conf/check_list_dws.conf
@@ -10,14 +10,10 @@ net.ipv4.tcp_keepalive_time = 30
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_retries2 = 12
-net.sctp.addip_enable = 0
net.core.wmem_max = 21299200
net.core.rmem_max = 21299200
net.core.wmem_default = 21299200
net.core.rmem_default = 21299200
-net.sctp.sctp_mem = 94500000 915000000 927000000
-net.sctp.sctp_rmem = 8192 250000 16777216
-net.sctp.sctp_wmem = 8192 250000 16777216
kernel.sem = 250 6400000 1000 25600
net.ipv4.tcp_rmem = 8192 250000 16777216
net.ipv4.tcp_wmem = 8192 250000 16777216
@@ -28,8 +24,6 @@ net.ipv4.tcp_max_syn_backlog = 65535
net.core.somaxconn = 65535
net.ipv4.tcp_syncookies = 1
vm.overcommit_memory = 0
-net.sctp.sndbuf_policy = 0
-net.sctp.rcvbuf_policy = 0
net.ipv4.tcp_fin_timeout = 60
kernel.shmall = 1152921504606846720
kernel.shmmax = 18446744073709551615
@@ -38,16 +32,11 @@ net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_retries1 = 10
net.ipv4.tcp_syn_retries = 10
net.ipv4.tcp_synack_retries = 10
-net.sctp.path_max_retrans = 10
-net.sctp.max_init_retransmits = 10
-net.sctp.association_max_retrans = 10
-net.sctp.hb_interval = 30000
vm.extfrag_threshold = 500
vm.overcommit_ratio = 90
# if parameter value is not equal to ths OS's value, print the waring, and not error
[SUGGEST:/etc/sysctl.conf]
-SctpChecksumErrors = 0
# open file number, please set it to set '1000000'
[/etc/security/limits.conf]
diff --git a/script/gspylib/inspection/config/check_list_V1R6C10.conf b/script/gspylib/inspection/config/check_list_V1R6C10.conf
index 75a2203..16c3fd2 100644
--- a/script/gspylib/inspection/config/check_list_V1R6C10.conf
+++ b/script/gspylib/inspection/config/check_list_V1R6C10.conf
@@ -10,14 +10,10 @@ net.ipv4.tcp_keepalive_time = 30
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_retries2 = 80
-net.sctp.addip_enable = 0
net.core.wmem_max = 21299200
net.core.rmem_max = 21299200
net.core.wmem_default = 21299200
net.core.rmem_default = 21299200
-net.sctp.sctp_mem = 94500000 915000000 927000000
-net.sctp.sctp_rmem = 8192 250000 16777216
-net.sctp.sctp_wmem = 8192 250000 16777216
kernel.sem = 250 6400000 1000 25600
net.ipv4.tcp_rmem = 8192 250000 16777216
net.ipv4.tcp_wmem = 8192 250000 16777216
@@ -30,8 +26,6 @@ net.ipv4.tcp_syncookies = 1
vm.overcommit_memory = 0
vm.panic_on_oom = 0;
vm.oom_kill_allocating_task = 0;
-net.sctp.sndbuf_policy = 0
-net.sctp.rcvbuf_policy = 0
# if parameter value is not equal to ths OS's value, print the waring, and not error
[SUGGEST:/etc/sysctl.conf]
@@ -41,10 +35,6 @@ net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_retries1 = 5
net.ipv4.tcp_syn_retries = 5
net.ipv4.tcp_synack_retries = 5
-net.sctp.path_max_retrans = 10
-net.sctp.max_init_retransmits = 10
-net.sctp.association_max_retrans = 10
-net.sctp.hb_interval = 30000
# open file number, please set it to set '1000000'
[/etc/security/limits.conf]
diff --git a/script/gspylib/inspection/config/check_list_V1R7C00.conf b/script/gspylib/inspection/config/check_list_V1R7C00.conf
index 41c9334..4c150b6 100644
--- a/script/gspylib/inspection/config/check_list_V1R7C00.conf
+++ b/script/gspylib/inspection/config/check_list_V1R7C00.conf
@@ -10,14 +10,10 @@ net.ipv4.tcp_keepalive_time = 30
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_retries2 = 80
-net.sctp.addip_enable = 0
net.core.wmem_max = 21299200
net.core.rmem_max = 21299200
net.core.wmem_default = 21299200
net.core.rmem_default = 21299200
-net.sctp.sctp_mem = 94500000 915000000 927000000
-net.sctp.sctp_rmem = 8192 250000 16777216
-net.sctp.sctp_wmem = 8192 250000 16777216
kernel.sem = 250 6400000 1000 25600
net.ipv4.tcp_rmem = 8192 250000 16777216
net.ipv4.tcp_wmem = 8192 250000 16777216
@@ -30,8 +26,6 @@ net.ipv4.tcp_syncookies = 1
vm.overcommit_memory = 0
vm.panic_on_oom = 0
vm.oom_kill_allocating_task = 0
-net.sctp.sndbuf_policy = 0
-net.sctp.rcvbuf_policy = 0
kernel.shmall = 1152921504606846720
kernel.shmmax = 18446744073709551615
@@ -43,13 +37,8 @@ net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_retries1 = 5
net.ipv4.tcp_syn_retries = 5
net.ipv4.tcp_synack_retries = 5
-net.sctp.path_max_retrans = 10
-net.sctp.max_init_retransmits = 10
-net.sctp.association_max_retrans = 10
-net.sctp.hb_interval = 30000
vm.extfrag_threshold = 500
vm.overcommit_ratio = 90
-SctpChecksumErrors = 0
# open file number, please set it to set '1000000'
[/etc/security/limits.conf]
diff --git a/script/gspylib/inspection/config/items.xml b/script/gspylib/inspection/config/items.xml
index 1dbac79..bb4143c 100644
--- a/script/gspylib/inspection/config/items.xml
+++ b/script/gspylib/inspection/config/items.xml
@@ -334,24 +334,6 @@
<analysis>default</analysis>
</checkitem>
- <checkitem id="10026" name="CheckNoCheckSum">
- <title>
- <zh>检查nochecksum值是否为预期值且一致(默认为N,RedHat6.4/6.5且bond是为Y)</zh>
- <en>Check the nochecksum</en>
- </title>
- <threshold/>
- <suggestion>
- <zh>修改nochecksum值为一致的预期值</zh>
- </suggestion>
- <standard>
- <zh>检查nochecksum值,若符合预期且一致则检查项通过,否则检查项不通过</zh>
- </standard>
- <category>network</category>
- <permission>root</permission>
- <scope>all</scope>
- <analysis>consistent</analysis>
- </checkitem>
-
<checkitem id="10027" name="CheckOmmUserExist">
<title>
<zh>检查omm用户是否已删除</zh>
@@ -456,24 +438,6 @@
<analysis>consistent</analysis>
</checkitem>
- <checkitem id="10032" name="CheckSctpService">
- <title>
- <zh>检查sctp服务</zh>
- <en>Check sctp service</en>
- </title>
- <threshold/>
- <suggestion>
- <zh>安装及加载sctp服务</zh>
- </suggestion>
- <standard>
- <zh>stcp服务开启且写在开机自启动文件中则检查项通过,否则检查项不通过</zh>
- </standard>
- <category>os</category>
- <permission>root</permission>
- <scope>all</scope>
- <analysis>default</analysis>
- </checkitem>
-
<checkitem id="10033" name="CheckHyperThread">
<title>
<zh>检查超线程是否打开</zh>
@@ -1841,7 +1805,7 @@
<zh>增大net.ipv4.ip_local_port_range或降低并发</zh>
</suggestion>
<standard>
- <zh>检查net.ipv4.ip_local_port_range,范围大于等于OS默认值通过;检查TCP协议随机端口数,小于总随机端口数的80%通过;检查SCTP协议随机端口数,小于总随机端口数的80%通过</zh>
+ <zh>检查net.ipv4.ip_local_port_range,范围大于等于OS默认值通过;检查TCP协议随机端口数,小于总随机端口数的80%通过</zh>
</standard>
<category>network</category>
<permission>user</permission>
diff --git a/script/gspylib/inspection/config/scene_inspect.xml b/script/gspylib/inspection/config/scene_inspect.xml
index 463e4b7..3ba6da3 100644
--- a/script/gspylib/inspection/config/scene_inspect.xml
+++ b/script/gspylib/inspection/config/scene_inspect.xml
@@ -40,12 +40,10 @@
<item name="CheckSshdConfig"/>
<item name="CheckCrondService"/>
<item name="CheckStack"/>
- <item name="CheckNoCheckSum"/>
<item name="CheckSysPortRange"/>
<item name="CheckMemInfo"/>
<item name="CheckHyperThread"/>
<item name="CheckTableSpace"/>
- <item name="CheckSctpService"/>
<item name="CheckSysadminUser"/>
<item name="CheckGUCConsistent"/>
<item name="CheckMaxProcMemory"/>
diff --git a/script/gspylib/inspection/config/scene_install.xml b/script/gspylib/inspection/config/scene_install.xml
index a189193..42b9547 100644
--- a/script/gspylib/inspection/config/scene_install.xml
+++ b/script/gspylib/inspection/config/scene_install.xml
@@ -12,13 +12,11 @@
<item name="CheckStack"/>
<item name="CheckCrondService"/>
<item name="CheckSshdService"/>
- <item name="CheckSctpService"/>
<item name="CheckSysParams">
<threshold>
version=V1R7C00
</threshold>
</item>
- <item name="CheckNoCheckSum"/>
<item name="CheckDiskFormat"/>
<item name="CheckEtcHosts"/>
<item name="CheckHyperThread"/>
diff --git a/script/gspylib/inspection/config/scene_upgrade.xml b/script/gspylib/inspection/config/scene_upgrade.xml
index 426785a..7356a21 100644
--- a/script/gspylib/inspection/config/scene_upgrade.xml
+++ b/script/gspylib/inspection/config/scene_upgrade.xml
@@ -23,7 +23,6 @@
version=V1R7C00
</threshold>
</item>
- <item name="CheckNoCheckSum"/>
<item name="CheckGUCValue"/>
<item name="CheckStack"/>
<item name="CheckDiskFormat"/>
diff --git a/script/gspylib/inspection/items/network/CheckNoCheckSum.py b/script/gspylib/inspection/items/network/CheckNoCheckSum.py
deleted file mode 100644
index 64d0e52..0000000
--- a/script/gspylib/inspection/items/network/CheckNoCheckSum.py
+++ /dev/null
@@ -1,71 +0,0 @@
-# -*- coding:utf-8 -*-
-# Copyright (c) 2020 Huawei Technologies Co.,Ltd.
-#
-# openGauss is licensed under Mulan PSL v2.
-# You can use this software according to the terms
-# and conditions of the Mulan PSL v2.
-# You may obtain a copy of Mulan PSL v2 at:
-#
-# http://license.coscl.org.cn/MulanPSL2
-#
-# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OF ANY KIND,
-# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
-# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
-# See the Mulan PSL v2 for more details.
-# ----------------------------------------------------------------------------
-import os
-import platform
-from gspylib.inspection.common import SharedFuncs
-from gspylib.inspection.common.CheckItem import BaseItem
-from gspylib.inspection.common.CheckResult import ResultStatus
-from gspylib.os.gsfile import g_file
-from gspylib.os.gsnetwork import g_network
-from gspylib.os.gsfile import g_Platform
-from gspylib.common.ErrorCode import ErrorCode
-
-
-class CheckNoCheckSum(BaseItem):
- def __init__(self):
- super(CheckNoCheckSum, self).__init__(self.__class__.__name__)
-
- def getOSversion(self):
- distname, version, idnum = g_Platform.dist()
- return distname, version
-
- def doCheck(self):
- if (not os.path.isfile("/sys/module/sctp/parameters/no_checksums")):
- self.result.rst = ResultStatus.OK
- self.result.val = "The SCTP service is not used and the" \
- " check item is skipped"
- return
- expect = "N"
- if (self.cluster):
- LocalNodeInfo = self.cluster.getDbNodeByName(self.host)
- serviceIP = LocalNodeInfo.backIps[0]
- else:
- serviceIP = SharedFuncs.getIpByHostName(self.host)
- for network in g_network.getAllNetworkInfo():
- if (network.ipAddress == serviceIP):
- networkCardNum = network.NICNum
- networkBond = network.networkBondModeInfo
- break
- if (not networkCardNum or not networkBond):
- raise Exception(ErrorCode.GAUSS_506["GAUSS_50619"])
- (distname, version) = self.getOSversion()
- if ((distname in ("redhat", "centos")) and
- (version in ("6.4", "6.5")) and
- networkBond != "BondMode Null"):
- expect = "Y"
-
- output = \
- g_file.readFile('/sys/module/sctp/parameters/no_checksums')[0]
- if (output.strip() == expect):
- self.result.rst = ResultStatus.OK
- self.result.val = "Nochecksum value is %s,Check items pass." \
- % output.strip()
- else:
- self.result.rst = ResultStatus.NG
- self.result.val = "Nochecksum value(%s) is not %s," \
- "Check items are not passed." \
- % (output.strip(), expect)
diff --git a/script/gspylib/inspection/items/network/CheckUsedPort.py b/script/gspylib/inspection/items/network/CheckUsedPort.py
index 8a635ed..9718d96 100644
--- a/script/gspylib/inspection/items/network/CheckUsedPort.py
+++ b/script/gspylib/inspection/items/network/CheckUsedPort.py
@@ -46,17 +46,9 @@ class CheckUsedPort(BaseItem):
return int(tcpUsed)
- def getSctpUsedPort(self):
- cmd = "cat /proc/net/sctp/assocs|" \
- "awk '{print $12}'|sort|uniq -c |wc -l"
- sctpUsed = SharedFuncs.runShellCmd(cmd)
-
- return int(sctpUsed)
-
def doCheck(self):
portRange = self.getPortRange()
tcpUsed = self.getTcpUsedPort()
- sctpUsed = self.getSctpUsedPort()
defaultPortRange = 60000 - 32768
if (portRange < defaultPortRange):
self.result.rst = ResultStatus.WARNING
@@ -70,14 +62,7 @@ class CheckUsedPort(BaseItem):
" not passed." % tcpUsed
return
- if (sctpUsed > portRange * 0.8):
- self.result.rst = ResultStatus.WARNING
- self.result.val = "sctp port used is %s," \
- "Check items are not passed." % sctpUsed
- return
-
self.result.rst = ResultStatus.OK
self.result.val = "port range is %s,tcp port used is %s," \
- "sctp port used is %d,Check items pass." \
- % (portRange, tcpUsed, sctpUsed)
+ "Check items pass." % (portRange, tcpUsed)
return
diff --git a/script/gspylib/inspection/items/os/CheckSctpService.py b/script/gspylib/inspection/items/os/CheckSctpService.py
deleted file mode 100644
index 8e00810..0000000
--- a/script/gspylib/inspection/items/os/CheckSctpService.py
+++ /dev/null
@@ -1,108 +0,0 @@
-# -*- coding:utf-8 -*-
-# Copyright (c) 2020 Huawei Technologies Co.,Ltd.
-#
-# openGauss is licensed under Mulan PSL v2.
-# You can use this software according to the terms
-# and conditions of the Mulan PSL v2.
-# You may obtain a copy of Mulan PSL v2 at:
-#
-# http://license.coscl.org.cn/MulanPSL2
-#
-# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OF ANY KIND,
-# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
-# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
-# See the Mulan PSL v2 for more details.
-# ----------------------------------------------------------------------------
-import subprocess
-import platform
-from gspylib.inspection.common.CheckItem import BaseItem
-from gspylib.inspection.common.CheckResult import ResultStatus
-from gspylib.common.Common import DefaultValue
-from gspylib.os.gsfile import g_Platform
-
-
-class CheckSctpService(BaseItem):
- def __init__(self):
- super(CheckSctpService, self).__init__(self.__class__.__name__)
-
- def doCheck(self):
-
- parRes = ""
- flag = "Normal"
- cmd = "ls -l /lib/modules/`uname -r`/kernel/net/sctp/sctp.ko*"
- (status, output) = subprocess.getstatusoutput(cmd)
- if (status != 0 or output == "" or output.find(
- "No such file or directory") > 0):
- if DefaultValue.checkDockerEnv():
- return
- flag = "Error"
- parRes += "There is no sctp service."
- else:
- cmd = "modprobe sctp;"
- cmd += "lsmod |grep sctp"
- (status, output) = subprocess.getstatusoutput(cmd)
- if (output == ""):
- flag = "Error"
- parRes += "sctp service is not loaded."
-
- cmd = "cat %s | grep '^insmod.*sctp.ko'" % DefaultValue.getOSInitFile()
- (status, output) = subprocess.getstatusoutput(cmd)
- if (status != 0 or output == ""):
- if (flag == "Normal"):
- flag = "Warning"
- parRes += "Sctp service is not set to boot from power on."
-
- self.result.val = parRes
- self.result.raw = output
- if (flag == "Error"):
- self.result.rst = ResultStatus.NG
- elif (flag == "Warning"):
- self.result.rst = ResultStatus.WARNING
- else:
- self.result.rst = ResultStatus.OK
- self.result.val = "Sctp service is Normal."
-
- def doSet(self):
- self.result.val = ""
- parRes = ""
- sctpFile = ""
- initFileSuse = "/etc/init.d/boot.local"
- initFileRedhat = "/etc/rc.d/rc.local"
- cmd = "ls -l /lib/modules/`uname -r`/kernel/net/sctp/sctp.ko*"
- (status, output) = subprocess.getstatusoutput(cmd)
- if (status != 0 or output == "" or output.find(
- "No such file or directory") > 0):
- parRes = "There is no sctp service.\n"
- else:
- sctpFile = output.split()[-1]
- cmd = "modprobe sctp;"
- (status, output) = subprocess.getstatusoutput(cmd)
- if (status != 0):
- cmd = "insmod %s >/dev/null 2>&1;lsmod |grep sctp" % sctpFile
- (status, output) = subprocess.getstatusoutput(cmd)
- if status != 0 or output == "":
- parRes = "Failed to load sctp service.\n"
- distname, version, idnum = g_Platform.dist()
- if (distname in ["redhat", "centos", "euleros", "openEuler"]):
- cmd = "cat %s | grep sctp" % initFileRedhat
- (status, output) = subprocess.getstatusoutput(cmd)
- if (status != 0 or output == ""):
- cmd = "echo 'modprobe sctp' >> /etc/rc.d/rc.local;"
- cmd += "echo" \
- " 'insmod %s >/dev/null 2>&1' >> /etc/rc.d/rc.local " \
- % sctpFile
- (status, output) = subprocess.getstatusoutput(cmd)
- if (status != 0):
- parRes += "Failed to add sctp service to boot.\n"
- else:
- cmd = "cat %s | grep stcp" % initFileSuse
- (status, output) = subprocess.getstatusoutput(cmd)
- if (status != 0 or output == ""):
- cmd = "echo 'modprobe sctp' >> /etc/init.d/boot.local;"
- cmd += "echo '%s >/dev/null 2>&1' >> /etc/init.d/boot.local " \
- % sctpFile
- (status, output) = subprocess.getstatusoutput(cmd)
- if (status != 0):
- parRes += "Failed to add sctp service to boot."
- self.result.val = parRes
diff --git a/script/gspylib/inspection/items/os/CheckSysParams.py b/script/gspylib/inspection/items/os/CheckSysParams.py
index 947ecc6..c15a627 100644
--- a/script/gspylib/inspection/items/os/CheckSysParams.py
+++ b/script/gspylib/inspection/items/os/CheckSysParams.py
@@ -122,21 +122,13 @@ class CheckSysParams(BaseItem):
for key in kernelParameter:
if (patchlevel == "1" and key == "vm.extfrag_threshold"):
continue
- if (key == "sctpchecksumerrors"):
- snmpFile = "/proc/net/sctp/snmp"
- if (os.path.isfile(snmpFile)):
- output = \
- g_file.readFile(snmpFile, 'SctpChecksumErrors')[
- 0].split()[1].strip()
- else:
- continue
- else:
- sysFile = "/proc/sys/%s" % key.replace('.', '/')
- # High version of linux no longer supports tcp_tw_recycle
- if (not os.path.exists(
- sysFile) and key == "net.ipv4.tcp_tw_recycle"):
- continue
- output = g_file.readFile(sysFile)[0].strip()
+
+ sysFile = "/proc/sys/%s" % key.replace('.', '/')
+ # High version of linux no longer supports tcp_tw_recycle
+ if (not os.path.exists(
+ sysFile) and key == "net.ipv4.tcp_tw_recycle"):
+ continue
+ output = g_file.readFile(sysFile)[0].strip()
if (len(output.split()) > 1):
output = ' '.join(output.split())
@@ -184,16 +176,6 @@ class CheckSysParams(BaseItem):
checkResultList = checkResult.split('\'')
setParameterList[checkResultList[1]] = checkResultList[5]
self.result.val = ""
- # The parameter sctpchecksumerrors set method is independent
- if ("sctpchecksumerrors" in setParameterList):
- cmd = "echo 1 > /sys/module/sctp/parameters/no_checksums"
- (status, output) = subprocess.getstatusoutput(cmd)
- if (status != 0):
- self.result.val += " " \
- " Failed to enforce sysctl kernel " \
- "variable 'sctpchecksumerrors'. " \
- "Error: %s" % output
- setParameterList.pop("sctpchecksumerrors")
if (len(setParameterList) != 0):
for key in setParameterList:
diff --git a/script/impl/preinstall/PreinstallImpl.py b/script/impl/preinstall/PreinstallImpl.py
index a35e87a..908423f 100644
--- a/script/impl/preinstall/PreinstallImpl.py
+++ b/script/impl/preinstall/PreinstallImpl.py
@@ -54,8 +54,6 @@ ACTION_PREPARE_USER_CRON_SERVICE = "prepare_user_cron_service"
ACTION_PREPARE_USER_SSHD_SERVICE = "prepare_user_sshd_service"
# set the dynamic link library
ACTION_SET_LIBRARY = "set_library"
-# set sctp service
-ACTION_SET_SCTP = "set_sctp"
# set virtual Ip
ACTION_SET_VIRTUALIP = "set_virtualIp"
# clean virtual Ip
@@ -1485,38 +1483,6 @@ class PreinstallImpl:
"""
pass
- def setSctp(self):
- """
- function: setting SCTP service
- input: NA
- output: NA
- """
- self.context.logger.log("Setting SCTP service.", "addStep")
- try:
- # set SCTP service
- cmd = "%s -t %s -u %s -l %s" % (
- OMCommand.getLocalScript("Local_PreInstall"),
- ACTION_SET_SCTP,
- self.context.user,
- self.context.localLog)
- # check the mpprcFile
- if self.context.mpprcFile != "":
- cmd += " -s '%s'" % self.context.mpprcFile
- self.context.logger.debug("Command for setting SCTP: %s" % cmd)
-
- # exec cmd for set SCTP
- DefaultValue.execCommandWithMode(
- cmd,
- "set SCTP",
- self.context.sshTool,
- self.context.localMode or self.context.isSingle,
- self.context.mpprcFile)
- except Exception as e:
- # failed set SCTP service
- raise Exception(str(e))
- # Successfully set SCTP service
- self.context.logger.log("Successfully set SCTP service.", "constant")
-
def setVirtualIp(self):
"""
function: set the virtual IPs
@@ -1893,10 +1859,6 @@ class PreinstallImpl:
self.checkOSVersion()
# create path and set mode
self.createDirs()
-
- # set Sctp
- if not DefaultValue.checkDockerEnv():
- self.setSctp()
# set os parameters
self.setAndCheckOSParameter()
# prepare cron service for user
diff --git a/script/local/LocalCheck.py b/script/local/LocalCheck.py
index 82a9efb..6e5cb6e 100644
--- a/script/local/LocalCheck.py
+++ b/script/local/LocalCheck.py
@@ -47,8 +47,7 @@ actioItemMap = {
docker_no_need_check = ["net.core.wmem_max", "net.core.rmem_max",
"net.core.wmem_default", "net.core.rmem_default",
- "net.sctp.sctp_mem", "net.sctp.sctp_rmem",
- "net.sctp.sctp_wmem", "net.core.netdev_max_backlog",
+ "net.core.netdev_max_backlog",
"net.ipv4.tcp_max_tw_buckets", "net.ipv4.tcp_tw_reuse",
"net.ipv4.tcp_tw_recycle", "net.ipv4.tcp_retries2",
"net.ipv4.ip_local_reserved_ports", "net.ipv4.tcp_rmem",
@@ -239,12 +238,7 @@ def checkSysctlParameter(kernelParameter, isSet):
continue
if (DefaultValue.checkDockerEnv() and key in docker_no_need_check):
continue
- # The parameter sctpchecksumerrors check method is independent
- if (key == "sctpchecksumerrors"):
- cmd = "cat /proc/net/sctp/snmp | grep SctpChecksumErrors" \
- " | awk '{print $2}'"
- else:
- cmd = "cat %s" % ("/proc/sys/%s" % key.replace('.', '/'))
+ cmd = "cat %s" % ("/proc/sys/%s" % key.replace('.', '/'))
(status, output) = subprocess.getstatusoutput(cmd)
if (status == 0):
if (key == "vm.min_free_kbytes"
@@ -315,15 +309,6 @@ def setOSParameter(setParameterList, patchlevel):
# vm.extfrag_threshold parameter, skip set
if ("vm.extfrag_threshold" in setParameterList and patchlevel == "1"):
setParameterList.pop("vm.extfrag_threshold")
- # The parameter sctpchecksumerrors set method is independent
- if ("sctpchecksumerrors" in setParameterList):
- cmd = "echo 1 > /sys/module/sctp/parameters/no_checksums"
- (status, output) = subprocess.getstatusoutput(cmd)
- if (status != 0):
- g_logger.debug("The cmd is %s " % cmd)
- g_logger.log(" Failed to enforce sysctl kernel variable"
- " 'sctpchecksumerrors'. Error: %s" % output)
- setParameterList.pop("sctpchecksumerrors")
if (len(setParameterList) != 0):
g_logger.debug("Setting sysctl parameter.")
@@ -332,7 +317,7 @@ def setOSParameter(setParameterList, patchlevel):
g_logger.log(" Set variable '%s' to '%s'"
% (key, setParameterList[key]))
cmd = "sysctl -p"
- (status, output) = subprocess.getstatusoutput(cmd)
+ (status, _) = subprocess.getstatusoutput(cmd)
if (status != 0):
cmderrorinfo = "sysctl -p | grep 'No such file or directory'"
(status, outputresult) = subprocess.getstatusoutput(cmderrorinfo)
diff --git a/script/local/PreInstallUtility.py b/script/local/PreInstallUtility.py
index cbe2a59..b4071f3 100644
--- a/script/local/PreInstallUtility.py
+++ b/script/local/PreInstallUtility.py
@@ -55,7 +55,6 @@ ACTION_SET_TOOL_ENV = "set_tool_env"
ACTION_PREPARE_USER_CRON_SERVICE = "prepare_user_cron_service"
ACTION_PREPARE_USER_SSHD_SERVICE = "prepare_user_sshd_service"
ACTION_SET_LIBRARY = "set_library"
-ACTION_SET_SCTP = "set_sctp"
ACTION_SET_VIRTUALIP = "set_virtualIp"
ACTION_CHECK_HOSTNAME_MAPPING = "check_hostname_mapping"
ACTION_INIT_GAUSSLOG = "init_gausslog"
@@ -256,7 +255,7 @@ Common options:
GaussLog.exitWithError(str(e))
parameter_list = [ACTION_CHECK_OS_VERSION, ACTION_SET_FINISH_FLAG,
ACTION_SET_USER_ENV, ACTION_SET_LIBRARY, \
- ACTION_SET_SCTP, ACTION_PREPARE_USER_CRON_SERVICE,
+ ACTION_PREPARE_USER_CRON_SERVICE,
ACTION_PREPARE_USER_SSHD_SERVICE, \
ACTION_SET_VIRTUALIP, ACTION_INIT_GAUSSLOG,
ACTION_CHECK_ENVFILE, ACTION_CHECK_OS_SOFTWARE, \
@@ -1981,88 +1980,6 @@ Common options:
self.logger.logExit(str(e))
self.logger.debug("Successfully set ARM Optimization.")
- def setSctp(self):
- """
- function: Setting SCTP
- input : NA
- output: NA
- """
- self.logger.debug("Setting SCTP.")
- try:
-
- key = "install ipv6 \/bin\/true"
- confFile = "/etc/modprobe.d/*ipv6.conf"
-
- initFile = DefaultValue.getOSInitFile()
- cmd = "ls %s" % confFile
- (status, output) = subprocess.getstatusoutput(cmd)
- if status == 0:
- cmd = "sed -i 's/^.*\(%s.*\)/#\\1/g' %s" % (key, confFile)
- (status, output) = subprocess.getstatusoutput(cmd)
- if status != 0:
- self.logger.logExit(ErrorCode.GAUSS_502["GAUSS_50223"]
- % confFile + " Error: \n%s" % output)
- cmd = "modprobe ipv6"
- (status, output) = subprocess.getstatusoutput(cmd)
- if status != 0:
- self.logger.logExit(ErrorCode.GAUSS_514["GAUSS_51400"] % cmd
- + " Error: \n%s" % output)
- cmd = "modprobe sctp"
- (status, output) = subprocess.getstatusoutput(cmd)
- if status != 0:
- self.logger.logExit(ErrorCode.GAUSS_514["GAUSS_51400"] % cmd
- + " Error: \n%s" % output)
-
- cmd = "uname -r"
- (status, output) = subprocess.getstatusoutput(cmd)
- if status != 0:
- self.logger.logExit(ErrorCode.GAUSS_514["GAUSS_51400"] % cmd
- + " Error: \n%s" % output)
-
- # Since redhat7.4 kernel module files ending in .xz
- stcpFile = "/lib/modules/%s/kernel/net/sctp/sctp.ko" \
- % output.strip()
- stcpFileXz = "/lib/modules/%s/kernel/net/sctp/sctp.ko.xz" \
- % output.strip()
- if (not os.path.exists(stcpFile)) and \
- (not os.path.exists(stcpFileXz)):
- output = stcpFile + " and " + stcpFileXz
- self.logger.logExit(ErrorCode.GAUSS_502["GAUSS_50201"]
- % output)
-
- cmd_insmod = "insmod %s >/dev/null 2>&1" % stcpFileXz
- (status, output) = subprocess.getstatusoutput(cmd_insmod)
-
- cmd_insmod = "insmod %s >/dev/null 2>&1" % stcpFile
- (status, output) = subprocess.getstatusoutput(cmd_insmod)
-
- cmd = "lsmod | grep 'sctp ' | wc -l"
- (status, output) = subprocess.getstatusoutput(cmd)
- if not str(output.strip()).isdigit() or int(output.strip()) == 0:
- self.logger.logExit(ErrorCode.GAUSS_514["GAUSS_51400"] % cmd
- + " Error: \n%s" % output)
-
- init_cmd = "sed -i '/^modprobe sctp$/d' %s &&" % initFile
- init_cmd += "echo \"modprobe sctp\" >> %s &&" % initFile
- init_cmd += "sed -i '/^insmod.*sctp.ko/d' %s &&" % initFile
- init_cmd += "echo \"%s\" >> %s" % (cmd_insmod, initFile)
- (status, output) = subprocess.getstatusoutput(init_cmd)
- if status != 0:
- self.logger.logExit(ErrorCode.GAUSS_514["GAUSS_51400"]
- % init_cmd + " Error: \n%s" % output)
-
- cmd = "sed -i \"/^sysctl -p/d\" %s &&" % initFile
- cmd += "echo \"sysctl -p\" >> %s" % initFile
- (status, output) = subprocess.getstatusoutput(cmd)
- if status != 0:
- self.logger.logExit(ErrorCode.GAUSS_514["GAUSS_51400"] % cmd
- + " Error: \n%s" % output)
-
- except Exception as e:
- self.logger.logExit(str(e))
-
- self.logger.debug("Successfully set Sctp.")
-
def checkVirtualIp(self):
"""
function: Checking virtual IP
@@ -2915,8 +2832,6 @@ Common options:
self.prepareUserSshdService()
elif self.action == ACTION_SET_LIBRARY:
self.setLibrary()
- elif self.action == ACTION_SET_SCTP:
- self.setSctp()
elif self.action == ACTION_SET_VIRTUALIP:
DefaultValue.modifyFileOwnerFromGPHOME(self.logger.logFile)
self.setVirtualIp()
--
2.6.4.windows.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。