mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-05 20:11:14 +08:00
script update
This commit is contained in:
parent
7772b9ff88
commit
8b04929f3d
@ -20,13 +20,13 @@ fi
|
||||
check=$(ps aux | grep -w ./${msg_gateway_name} | grep -v grep | wc -l)
|
||||
if [ $check -ge 1 ]; then
|
||||
oldPid=$(ps aux | grep -w ./${msg_gateway_name} | grep -v grep | awk '{print $2}')
|
||||
kill -9 ${oldPid}
|
||||
kill -9 ${oldPid}
|
||||
fi
|
||||
#Waiting port recycling
|
||||
sleep 3
|
||||
cd ${msg_gateway_binary_root}
|
||||
for ((i = 0; i < ${#ws_ports[@]}; i++)); do
|
||||
nohup ./${msg_gateway_name} -rpc_port ${rpc_ports[$i]} -ws_port ${ws_ports[$i]} >>../logs/${msg_gateway_name}.$(date +%Y-%m-%d).log 2>&1 &
|
||||
nohup ./${msg_gateway_name} -rpc_port ${rpc_ports[$i]} -ws_port ${ws_ports[$i]} >>../logs/${msg_gateway_name}.log 2>&1 &
|
||||
done
|
||||
|
||||
#Check launched service process
|
||||
@ -37,7 +37,7 @@ if [ $check -ge 1 ]; then
|
||||
allNewPid=$(ps aux | grep -w ./${msg_gateway_name} | grep -v grep | awk '{print $2}')
|
||||
for i in $allNewPid; do
|
||||
ports=$(netstat -netulp | grep ${i} | awk '{print $4}' | awk -F '[:]' '{print $NF}')
|
||||
allPorts=${allPorts}"$ports "
|
||||
allPorts=${allPorts}"$ports "
|
||||
done
|
||||
echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS !!!"${COLOR_SUFFIX}
|
||||
echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${msg_gateway_name}${COLOR_SUFFIX}
|
||||
|
@ -16,7 +16,7 @@ fi
|
||||
#Waiting port recycling
|
||||
sleep 1
|
||||
cd ${msg_transfer_binary_root}
|
||||
nohup ./${msg_transfer_name} >>../logs/${msg_transfer_name}.`date +%Y-%m-%d`.log 2>&1 &
|
||||
nohup ./${msg_transfer_name} >>../logs/${msg_transfer_name}.log 2>&1 &
|
||||
#Check launched service process
|
||||
check=`ps aux | grep -w ./${msg_transfer_name} | grep -v grep| wc -l`
|
||||
if [ $check -eq 1 ]
|
||||
|
@ -22,7 +22,7 @@ sleep 1
|
||||
cd ${push_binary_root}
|
||||
|
||||
for ((i = 0; i < ${#rpc_ports[@]}; i++)); do
|
||||
nohup ./${push_name} -port ${rpc_ports[$i]} >>../logs/${push_name}.$(date +%Y-%m-%d).log 2>&1 &
|
||||
nohup ./${push_name} -port ${rpc_ports[$i]} >>../logs/${push_name}.log 2>&1 &
|
||||
done
|
||||
|
||||
|
||||
|
@ -10,10 +10,14 @@ need_to_start_server_shell=(
|
||||
msg_transfer_start.sh
|
||||
)
|
||||
|
||||
#fixme The 10 second delay to start the project is for the docker-compose one-click to start openIM when the infrastructure dependencies are not started
|
||||
sleep 10
|
||||
|
||||
for i in ${need_to_start_server_shell[*]}; do
|
||||
chmod +x $i
|
||||
./$i
|
||||
done
|
||||
#fixme The infinite loop prevents the ope IM service from exiting after execution in the docker container
|
||||
while [ true ]; do
|
||||
sleep 60
|
||||
done
|
||||
|
@ -51,7 +51,7 @@ for ((i = 0; i < ${#service_filename[*]}; i++)); do
|
||||
echo -e "${SKY_BLUE_PREFIX}${service_filename[$i]} Service is starting,port number:$j $COLOR_SUFFIX"
|
||||
#Start the service in the background
|
||||
# ./${service_filename[$i]} -port $j &
|
||||
nohup ./${service_filename[$i]} -port $j >../logs/openIM.log 2>&1 &
|
||||
nohup ./${service_filename[$i]} -port $j >>../logs/openIM.log 2>&1 &
|
||||
sleep 1
|
||||
pid="netstat -ntlp|grep $j |awk '{printf \$7}'|cut -d/ -f1"
|
||||
echo -e "${RED_PREFIX}${service_filename[$i]} Service is started,port number:$j pid:$(eval $pid)$COLOR_SUFFIX"
|
||||
|
Loading…
x
Reference in New Issue
Block a user