!958 适配资源池化删除cm_persist

Merge pull request !958 from Carl/master
This commit is contained in:
opengauss_bot 2024-10-30 07:28:06 +00:00 committed by Gitee
commit 513049dabb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 5 additions and 13 deletions

View File

@ -479,10 +479,8 @@ General options:
# target tools
bin_files = ['./bin/encrypt']
dss_files = []
cm_files = []
memcheck_files = []
if self.clusterInfo.enable_dss == 'on':
cm_files = ['bin/cm_persist']
dss_files = ['./bin/perctrl', './bin/dsscmd', './lib/libdssapi.so', './bin/dss_clear.sh']
if self.og_version_cfg['mode'] == 'memcheck':
memcheck_files = ['./lib/libasan.so', './lib/libasan.so.6', './lib/libasan.so.6.0.0']
@ -500,10 +498,9 @@ General options:
# unpack and move tools into target path
cmd = 'cd {} && '.format(root)
cmd += 'tar -xpf {}*.tar.bz2 {} && '.format(pkg_prefix, ' '.join(bin_files + dss_files + memcheck_files))
if cm_files:
cmd += 'tar -xpf {}*.tar.gz {} && '.format(pkg_prefix.replace("Server", "CM"), ' '.join(cm_files))
if dss_files:
cmd += 'mkdir -p {0} -m u=rwx && '.format(clib_dss)
cmd += 'mv {} {} && '.format(' '.join(cm_files + dss_files), clib_dss)
cmd += 'mv {} {} && '.format(' '.join(dss_files), clib_dss)
if memcheck_root_lib != '':
cmd += 'cp ./lib/libasan.so.6 {} &&'.format(memcheck_root_lib)
cmd += '\mv {} {} && '.format(' '.join(bin_files + memcheck_files), clib)

View File

@ -352,7 +352,7 @@ class Install(LocalBaseOM):
def check_clib_bin(self, clib_bin, bin_file):
"""
Check perctrl or cm_persist in GPHOME clib path.
Check perctrl in GPHOME clib path.
If not in, copy if from installPath
"""
if os.path.exists(clib_bin):
@ -387,7 +387,7 @@ class Install(LocalBaseOM):
if not os.path.isdir(dss_app):
raise Exception(ErrorCode.GAUSS_502["GAUSS_50201"] % dss_app)
sudo_bin = ['perctrl', 'cm_persist']
sudo_bin = ['perctrl']
for bin_ in sudo_bin:
clib_bin = os.path.realpath(os.path.join(clib_app, bin_))
self.check_clib_bin(clib_bin, bin_)
@ -399,8 +399,7 @@ class Install(LocalBaseOM):
raise Exception(ErrorCode.GAUSS_514["GAUSS_51400"] % mv_cmd +
"Error:\n%s" % output)
link_cmd = 'ln -snf {0}/cm_persist {0}/perctrl {1}'.format(
dss_app, bin_path)
link_cmd = 'ln -snf {0}/perctrl {1}'.format(dss_app, bin_path)
self.logger.debug(f"The cmd of the link: {link_cmd}.")
status, output = subprocess.getstatusoutput(link_cmd)
if status != 0:

View File

@ -2895,8 +2895,6 @@ Common options:
FileUtil.changeMode(DefaultValue.BIN_FILE_MODE,
os.path.join(clib_app, file_))
FileUtil.change_caps(DefaultValue.CAP_WIO,
os.path.join(clib_app, 'cm_persist'))
FileUtil.change_caps('{},{}'.format(DefaultValue.CAP_ADM, DefaultValue.CAP_WIO),
os.path.join(clib_app, 'perctrl'))
self.logger.debug("Successfully modified dss cap permissions.")

View File

@ -2336,8 +2336,6 @@ def cleanInstallPath():
delete_bin = os.path.join(appBakPath, f'gaussdb_{commit_id}/bin')
cmd += " && (if [ -L '{0}' ]; then unlink '{0}'; fi)".format(
os.path.join(delete_bin, 'perctrl'))
cmd += " && (if [ -L '{0}' ]; then unlink '{0}'; fi)".format(
os.path.join(delete_bin, 'cm_persist'))
cmd += " && (if [ -d '%s' ]; then cp -r '%s/' '%s/to_be_delete/'; fi)" % (
installPath, installPath, tmpDir)
g_logger.debug(