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

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

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