提交 06dd366a 编写于 作者: H Hui Li

[TD-2947]<fix>when update version, first stop nginx

上级 ffb7b03a
...@@ -147,8 +147,8 @@ done ...@@ -147,8 +147,8 @@ done
#echo "verType=${verType} interactiveFqdn=${interactiveFqdn}" #echo "verType=${verType} interactiveFqdn=${interactiveFqdn}"
function kill_taosd() { function kill_process() {
pid=$(ps -ef | grep "taosd" | grep -v "grep" | awk '{print $2}') pid=$(ps -ef | grep "$1" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then if [ -n "$pid" ]; then
${csudo} kill -9 $pid || : ${csudo} kill -9 $pid || :
fi fi
...@@ -168,7 +168,10 @@ function install_main_path() { ...@@ -168,7 +168,10 @@ function install_main_path() {
if [ "$verMode" == "cluster" ]; then if [ "$verMode" == "cluster" ]; then
${csudo} mkdir -p ${nginx_dir} ${csudo} mkdir -p ${nginx_dir}
fi fi
if [[ -e ${script_dir}/email ]]; then
${csudo} cp ${script_dir}/email ${install_main_dir}/ ||: ${csudo} cp ${script_dir}/email ${install_main_dir}/ ||:
fi
} }
function install_bin() { function install_bin() {
...@@ -680,7 +683,7 @@ function install_service() { ...@@ -680,7 +683,7 @@ function install_service() {
install_service_on_sysvinit install_service_on_sysvinit
else else
# must manual stop taosd # must manual stop taosd
kill_taosd kill_process taosd
fi fi
} }
...@@ -749,11 +752,24 @@ function update_TDengine() { ...@@ -749,11 +752,24 @@ function update_TDengine() {
elif ((${service_mod}==1)); then elif ((${service_mod}==1)); then
${csudo} service taosd stop || : ${csudo} service taosd stop || :
else else
kill_taosd kill_process taosd
fi fi
sleep 1 sleep 1
fi fi
if [ "$verMode" == "cluster" ]; then
if pidof nginx &> /dev/null; then
if ((${service_mod}==0)); then
${csudo} systemctl stop nginxd || :
elif ((${service_mod}==1)); then
${csudo} service nginxd stop || :
else
kill_process nginx
fi
sleep 1
fi
fi
install_main_path install_main_path
install_log install_log
......
...@@ -146,8 +146,8 @@ done ...@@ -146,8 +146,8 @@ done
#echo "verType=${verType} interactiveFqdn=${interactiveFqdn}" #echo "verType=${verType} interactiveFqdn=${interactiveFqdn}"
function kill_powerd() { function kill_process() {
pid=$(ps -ef | grep "powerd" | grep -v "grep" | awk '{print $2}') pid=$(ps -ef | grep "$1" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then if [ -n "$pid" ]; then
${csudo} kill -9 $pid || : ${csudo} kill -9 $pid || :
fi fi
...@@ -652,7 +652,7 @@ function install_service() { ...@@ -652,7 +652,7 @@ function install_service() {
install_service_on_sysvinit install_service_on_sysvinit
else else
# must manual stop powerd # must manual stop powerd
kill_powerd kill_process powerd
fi fi
} }
...@@ -721,10 +721,22 @@ function update_PowerDB() { ...@@ -721,10 +721,22 @@ function update_PowerDB() {
elif ((${service_mod}==1)); then elif ((${service_mod}==1)); then
${csudo} service powerd stop || : ${csudo} service powerd stop || :
else else
kill_powerd kill_process powerd
fi fi
sleep 1 sleep 1
fi fi
if [ "$verMode" == "cluster" ]; then
if pidof nginx &> /dev/null; then
if ((${service_mod}==0)); then
${csudo} systemctl stop nginxd || :
elif ((${service_mod}==1)); then
${csudo} service nginxd stop || :
else
kill_process nginx
fi
sleep 1
fi
fi
install_main_path install_main_path
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册