From ba195f5cc379b62bc40d53b2e3bd811c33df5cab Mon Sep 17 00:00:00 2001 From: chenzhikai <895543892@qq.com> Date: Wed, 30 Oct 2024 15:00:15 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E8=B5=84=E6=BA=90=E6=B1=A0?= =?UTF-8?q?=E5=8C=96=E5=88=A0=E9=99=A4cm=5Fpersist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/gs_preinstall | 7 ++----- script/local/Install.py | 7 +++---- script/local/PreInstallUtility.py | 2 -- script/local/UpgradeUtility.py | 2 -- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/script/gs_preinstall b/script/gs_preinstall index a4eca23..bcdd04b 100644 --- a/script/gs_preinstall +++ b/script/gs_preinstall @@ -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) diff --git a/script/local/Install.py b/script/local/Install.py index 6cc0531..9da2195 100644 --- a/script/local/Install.py +++ b/script/local/Install.py @@ -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: diff --git a/script/local/PreInstallUtility.py b/script/local/PreInstallUtility.py index bdf56d3..73c5fbb 100644 --- a/script/local/PreInstallUtility.py +++ b/script/local/PreInstallUtility.py @@ -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.") diff --git a/script/local/UpgradeUtility.py b/script/local/UpgradeUtility.py index 13ece1a..591a410 100644 --- a/script/local/UpgradeUtility.py +++ b/script/local/UpgradeUtility.py @@ -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(