mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-28 06:22:12 +08:00
fix: start don't kill old process
Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
This commit is contained in:
parent
dc419794e7
commit
ac7e909463
@ -50,11 +50,11 @@ if [ ${#rpc_ports[@]} -ne ${#ws_ports[@]} ]; then
|
|||||||
fi
|
fi
|
||||||
#Check if the service exists
|
#Check if the service exists
|
||||||
#If it is exists,kill this process
|
#If it is exists,kill this process
|
||||||
check=$(ps aux | grep -w ./${openim_msggateway} | grep -v grep | wc -l)
|
#check=$(ps aux | grep -w ./${openim_msggateway} | grep -v grep | wc -l)
|
||||||
if [ $check -ge 1 ]; then
|
#if [ $check -ge 1 ]; then
|
||||||
oldPid=$(ps aux | grep -w ./${openim_msggateway} | grep -v grep | awk '{print $2}')
|
# oldPid=$(ps aux | grep -w ./${openim_msggateway} | grep -v grep | awk '{print $2}')
|
||||||
kill -9 ${oldPid}
|
# kill -9 ${oldPid}
|
||||||
fi
|
#fi
|
||||||
#Waiting port recycling
|
#Waiting port recycling
|
||||||
sleep 1
|
sleep 1
|
||||||
cd ${msg_gateway_binary_root}
|
cd ${msg_gateway_binary_root}
|
||||||
|
|||||||
@ -37,12 +37,12 @@ prome_ports=($ports_array)
|
|||||||
|
|
||||||
#Check if the service exists
|
#Check if the service exists
|
||||||
#If it is exists,kill this process
|
#If it is exists,kill this process
|
||||||
check=`ps | grep -w ./${openim_msgtransfer} | grep -v grep| wc -l`
|
#check=`ps | grep -w ./${openim_msgtransfer} | grep -v grep| wc -l`
|
||||||
if [ $check -ge 1 ]
|
#if [ $check -ge 1 ]
|
||||||
then
|
#then
|
||||||
oldPid=`ps | grep -w ./${openim_msgtransfer} | grep -v grep|awk '{print $2}'`
|
#oldPid=`ps | grep -w ./${openim_msgtransfer} | grep -v grep|awk '{print $2}'`
|
||||||
kill -9 $oldPid
|
# kill -9 $oldPid
|
||||||
fi
|
#fi
|
||||||
#Waiting port recycling
|
#Waiting port recycling
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
|
|||||||
@ -44,11 +44,11 @@ prome_ports=($ports_array)
|
|||||||
|
|
||||||
#Check if the service exists
|
#Check if the service exists
|
||||||
#If it is exists,kill this process
|
#If it is exists,kill this process
|
||||||
check=$(ps | grep -w ./${push_name} | grep -v grep | wc -l)
|
#check=$(ps | grep -w ./${push_name} | grep -v grep | wc -l)
|
||||||
if [ $check -ge 1 ]; then
|
#if [ $check -ge 1 ]; then
|
||||||
oldPid=$(ps | grep -w ./${push_name} | grep -v grep | awk '{print $2}')
|
# oldPid=$(ps | grep -w ./${push_name} | grep -v grep | awk '{print $2}')
|
||||||
kill -9 $oldPid
|
# kill -9 $oldPid
|
||||||
fi
|
#fi
|
||||||
#Waiting port recycling
|
#Waiting port recycling
|
||||||
sleep 1
|
sleep 1
|
||||||
cd ${push_binary_root}
|
cd ${push_binary_root}
|
||||||
|
|||||||
@ -35,11 +35,11 @@ logs_dir="$OPENIM_ROOT/logs"
|
|||||||
#Check if the service exists
|
#Check if the service exists
|
||||||
#If it is exists,kill this process
|
#If it is exists,kill this process
|
||||||
check=`ps | grep -w ./${cron_task_name} | grep -v grep| wc -l`
|
check=`ps | grep -w ./${cron_task_name} | grep -v grep| wc -l`
|
||||||
if [ $check -ge 1 ]
|
#if [ $check -ge 1 ]
|
||||||
then
|
#then
|
||||||
oldPid=`ps | grep -w ./${cron_task_name} | grep -v grep|awk '{print $2}'`
|
#oldPid=`ps | grep -w ./${cron_task_name} | grep -v grep|awk '{print $2}'`
|
||||||
kill -9 $oldPid
|
# kill -9 $oldPid
|
||||||
fi
|
#fi
|
||||||
#Waiting port recycling
|
#Waiting port recycling
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
|
|||||||
@ -78,14 +78,14 @@ for ((i = 0; i < ${#service_filename[*]}; i++)); do
|
|||||||
service_name="ps |grep -w ${service_filename[$i]} |grep -v grep"
|
service_name="ps |grep -w ${service_filename[$i]} |grep -v grep"
|
||||||
count="${service_name}| wc -l"
|
count="${service_name}| wc -l"
|
||||||
|
|
||||||
if [ $(eval ${count}) -gt 0 ]; then
|
# if [ $(eval ${count}) -gt 0 ]; then
|
||||||
pid="${service_name}| awk '{print \$2}'"
|
# pid="${service_name}| awk '{print \$2}'"
|
||||||
echo "${service_filename[$i]} service has been started,pid:$(eval $pid)"
|
# echo "${service_filename[$i]} service has been started,pid:$(eval $pid)"
|
||||||
echo "killing the service ${service_filename[$i]} pid:$(eval $pid)"
|
# echo "killing the service ${service_filename[$i]} pid:$(eval $pid)"
|
||||||
#kill the service that existed
|
# #kill the service that existed
|
||||||
kill -9 $(eval $pid)
|
# kill -9 $(eval $pid)
|
||||||
sleep 0.5
|
# sleep 0.5
|
||||||
fi
|
# fi
|
||||||
cd $OPENIM_ROOT
|
cd $OPENIM_ROOT
|
||||||
cd $BIN_DIR
|
cd $BIN_DIR
|
||||||
# Get the rpc port in the configuration file
|
# Get the rpc port in the configuration file
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user