diff --git a/script/msg_gateway_start.sh b/script/msg_gateway_start.sh index c9bcf953c..fdf53e608 100644 --- a/script/msg_gateway_start.sh +++ b/script/msg_gateway_start.sh @@ -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} diff --git a/script/msg_transfer_start.sh b/script/msg_transfer_start.sh index dff8320cb..1ccc9abc0 100644 --- a/script/msg_transfer_start.sh +++ b/script/msg_transfer_start.sh @@ -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 ] diff --git a/script/push_start.sh b/script/push_start.sh index 43fdd9288..5bc71c271 100644 --- a/script/push_start.sh +++ b/script/push_start.sh @@ -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 diff --git a/script/start_all.sh b/script/start_all.sh index b504efb09..e400d4017 100644 --- a/script/start_all.sh +++ b/script/start_all.sh @@ -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 diff --git a/script/start_rpc_service.sh b/script/start_rpc_service.sh index 5c012a400..74f00a3f4 100644 --- a/script/start_rpc_service.sh +++ b/script/start_rpc_service.sh @@ -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"