From 977a2f312b64a8d51e220b5ed7aa036ad3e32a1d Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Sat, 6 Nov 2021 13:34:24 +0800 Subject: [PATCH] Hotfix/sangshuduo/td 10863 blm3 service centos7 (#8598) * [TD-10863]: blm3 service on centos7 * fix cmake define to support build_http better * install for libtaos required by go build * fix blm3 service install seq * make rpm erase all files in /usr/loca/taos --- packaging/tools/install.sh | 4 ++-- packaging/tools/make_install.sh | 32 +++++++++++++------------------- packaging/tools/post.sh | 4 ++-- packaging/tools/preun.sh | 2 +- packaging/tools/startPre.sh | 4 ++-- 5 files changed, 20 insertions(+), 26 deletions(-) diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh index 33097bd541..bb87d91076 100755 --- a/packaging/tools/install.sh +++ b/packaging/tools/install.sh @@ -455,7 +455,7 @@ function install_blm3_config() { fi [ -f ${script_dir}/cfg/blm.toml ] && - ${csudo} cp -f ${script_dir}/cfg/blm.toml ${install_main_dir}/cfg/blm.toml.org + ${csudo} cp -f ${script_dir}/cfg/blm.toml ${cfg_install_dir}/blm.toml.new [ -f ${cfg_install_dir}/blm.toml ] && ${csudo} ln -s ${cfg_install_dir}/blm.toml ${install_main_dir}/cfg/blm.toml @@ -473,7 +473,7 @@ function install_config() { ${csudo} chmod 644 ${cfg_install_dir}/* fi - ${csudo} cp -f ${script_dir}/cfg/taos.cfg ${install_main_dir}/cfg/taos.cfg.org + ${csudo} cp -f ${script_dir}/cfg/taos.cfg ${cfg_install_dir}/taos.cfg.new ${csudo} ln -s ${cfg_install_dir}/taos.cfg ${install_main_dir}/cfg [ ! -z $1 ] && return 0 || : # only install client diff --git a/packaging/tools/make_install.sh b/packaging/tools/make_install.sh index c29c1cd665..8052f4e811 100755 --- a/packaging/tools/make_install.sh +++ b/packaging/tools/make_install.sh @@ -351,15 +351,13 @@ function install_config() { [ -f ${script_dir}/../cfg/taos.cfg ] && ${csudo} cp ${script_dir}/../cfg/taos.cfg ${cfg_install_dir} ${csudo} chmod 644 ${cfg_install_dir}/taos.cfg - ${csudo} cp -f ${script_dir}/../cfg/taos.cfg ${install_main_dir}/cfg/taos.cfg.org - ${csudo} ln -s ${cfg_install_dir}/taos.cfg ${install_main_dir}/cfg/taos.cfg + ${csudo} cp -f ${script_dir}/../cfg/taos.cfg \ + ${cfg_install_dir}/taos.cfg.${verNumber} + ${csudo} ln -s ${cfg_install_dir}/taos.cfg \ + ${install_main_dir}/cfg/taos.cfg else - if [ "$osType" != "Darwin" ]; then - ${csudo} cp -f ${script_dir}/../cfg/taos.cfg ${install_main_dir}/cfg/taos.cfg.org - else - ${csudo} cp -f ${script_dir}/../cfg/taos.cfg ${install_main_dir}/cfg/taos.cfg.org\ - || ${csudo} cp -f ${script_dir}/../cfg/taos.cfg ${install_main_2_dir}/cfg/taos.cfg.org - fi + ${csudo} cp -f ${script_dir}/../cfg/taos.cfg \ + ${cfg_install_dir}/taos.cfg.${verNumber} fi } @@ -371,19 +369,15 @@ function install_blm3_config() { [ -f ${cfg_install_dir}/blm.toml ] && ${csudo} chmod 644 ${cfg_install_dir}/blm.toml [ -f ${binary_dir}/test/cfg/blm.toml ] && - ${csudo} cp -f ${binary_dir}/test/cfg/blm.toml ${install_main_dir}/cfg/blm.toml.org - [ -f ${cfg_install_dir}/blm.toml ] && - ${csudo} ln -s ${cfg_install_dir}/blm.toml ${install_main_dir}/cfg/blm.toml + ${csudo} cp -f ${binary_dir}/test/cfg/blm.toml \ + ${cfg_install_dir}/blm.toml.${verNumber} + [ -f ${cfg_install_dir}/blm.toml ] && \ + ${csudo} ln -s ${cfg_install_dir}/blm.toml \ + ${install_main_dir}/cfg/blm.toml else if [ -f "${binary_dir}/test/cfg/blm.toml" ]; then - if [ "$osType" != "Darwin" ]; then - ${csudo} cp -f ${binary_dir}/test/cfg/blm.toml \ - ${install_main_dir}/cfg/blm.toml.org - else - ${csudo} cp -f ${binary_dir}/test/cfg/blm.toml ${install_main_dir}/cfg/blm.toml.org \ - || ${csudo} cp -f ${binary_dir}/test/cfg/blm.toml \ - ${install_main_2_dir}/cfg/blm.toml.org - fi + ${csudo} cp -f ${binary_dir}/test/cfg/blm.toml \ + ${cfg_install_dir}/blm.toml.${verNumber} fi fi } diff --git a/packaging/tools/post.sh b/packaging/tools/post.sh index 87f17fb56a..2f6d9ac784 100755 --- a/packaging/tools/post.sh +++ b/packaging/tools/post.sh @@ -301,7 +301,7 @@ function install_blm3_config() { fi [ -f ${cfg_dir}/blm.toml ] && - ${csudo} mv ${cfg_dir}/blm.toml ${cfg_dir}/blm.toml.org + ${csudo} mv ${cfg_dir}/blm.toml ${cfg_dir}/blm.toml.new [ -f ${cfg_install_dir}/blm.toml ] && ${csudo} ln -s ${cfg_install_dir}/blm.toml ${cfg_dir} @@ -322,7 +322,7 @@ function install_config() { # restore the backup standard input, and turn off 6 exec 0<&6 6<&- - ${csudo} mv ${cfg_dir}/taos.cfg ${cfg_dir}/taos.cfg.org + ${csudo} mv ${cfg_dir}/taos.cfg ${cfg_dir}/taos.cfg.new ${csudo} ln -s ${cfg_install_dir}/taos.cfg ${cfg_dir} #FQDN_FORMAT="(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" #FQDN_FORMAT="(:[1-6][0-9][0-9][0-9][0-9]$)" diff --git a/packaging/tools/preun.sh b/packaging/tools/preun.sh index 7f6ef5c27d..f6daeefdd5 100755 --- a/packaging/tools/preun.sh +++ b/packaging/tools/preun.sh @@ -124,7 +124,7 @@ ${csudo} rm -f ${bin_link_dir}/blm3 || : ${csudo} rm -f ${bin_link_dir}/taosdemo || : ${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${bin_link_dir}/set_core || : -${csudo} rm -f ${cfg_link_dir}/* || : +${csudo} rm -f ${cfg_link_dir}/*.new || : ${csudo} rm -f ${inc_link_dir}/taos.h || : ${csudo} rm -f ${inc_link_dir}/taoserror.h || : ${csudo} rm -f ${lib_link_dir}/libtaos.* || : diff --git a/packaging/tools/startPre.sh b/packaging/tools/startPre.sh index 731f5b396f..8a0ab11a4d 100755 --- a/packaging/tools/startPre.sh +++ b/packaging/tools/startPre.sh @@ -9,8 +9,8 @@ line=`grep StartLimitBurst ${taosd}` num=${line##*=} #echo "burst num: ${num}" -startSeqFile=/usr/local/taos/.startSeq -recordFile=/usr/local/taos/.startRecord +startSeqFile=/var/log/taos/.startSeq +recordFile=/var/log/taos/.startRecord startSeq=0 -- GitLab