mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-27 03:58:55 +08:00
shell update
This commit is contained in:
parent
83228d8aa6
commit
d720082644
@ -15,7 +15,14 @@ need_to_start_server_shell=(
|
|||||||
#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
|
#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
|
sleep 10
|
||||||
|
time=`date +"%Y-%m-%d %H:%M:%S"`
|
||||||
|
echo "==========================================================">>../logs/openIM.log 2>&1 &
|
||||||
|
echo "==========================================================">>../logs/openIM.log 2>&1 &
|
||||||
|
echo "==========================================================">>../logs/openIM.log 2>&1 &
|
||||||
|
echo "==========server start time:${time}===========">>../logs/openIM.log 2>&1 &
|
||||||
|
echo "==========================================================">>../logs/openIM.log 2>&1 &
|
||||||
|
echo "==========================================================">>../logs/openIM.log 2>&1 &
|
||||||
|
echo "==========================================================">>../logs/openIM.log 2>&1 &
|
||||||
for i in ${need_to_start_server_shell[*]}; do
|
for i in ${need_to_start_server_shell[*]}; do
|
||||||
chmod +x $i
|
chmod +x $i
|
||||||
./$i
|
./$i
|
||||||
|
@ -14,7 +14,7 @@ ws_ports=($ports_array)
|
|||||||
if [ ${#rpc_ports[@]} -ne ${#ws_ports[@]} ]; then
|
if [ ${#rpc_ports[@]} -ne ${#ws_ports[@]} ]; then
|
||||||
|
|
||||||
echo -e ${RED_PREFIX}"ws_ports does not match push_rpc_ports in quantity!!!"${COLOR_SUFFIX}
|
echo -e ${RED_PREFIX}"ws_ports does not match push_rpc_ports in quantity!!!"${COLOR_SUFFIX}
|
||||||
exit 0
|
exit -1
|
||||||
|
|
||||||
fi
|
fi
|
||||||
#Check if the service exists
|
#Check if the service exists
|
||||||
|
@ -11,8 +11,19 @@ need_to_start_server_shell=(
|
|||||||
sdk_svr_start.sh
|
sdk_svr_start.sh
|
||||||
demo_svr_start.sh
|
demo_svr_start.sh
|
||||||
)
|
)
|
||||||
|
time=`date +"%Y-%m-%d %H:%M:%S"`
|
||||||
|
echo "==========================================================">>../logs/openIM.log 2>&1 &
|
||||||
|
echo "==========================================================">>../logs/openIM.log 2>&1 &
|
||||||
|
echo "==========================================================">>../logs/openIM.log 2>&1 &
|
||||||
|
echo "==========server start time:${time}===========">>../logs/openIM.log 2>&1 &
|
||||||
|
echo "==========================================================">>../logs/openIM.log 2>&1 &
|
||||||
|
echo "==========================================================">>../logs/openIM.log 2>&1 &
|
||||||
|
echo "==========================================================">>../logs/openIM.log 2>&1 &
|
||||||
|
|
||||||
for i in ${need_to_start_server_shell[*]}; do
|
for i in ${need_to_start_server_shell[*]}; do
|
||||||
chmod +x $i
|
chmod +x $i
|
||||||
./$i
|
./$i
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
@ -45,24 +45,23 @@ for ((i = 0; i < ${#service_filename[*]}; i++)); do
|
|||||||
|
|
||||||
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 -e "${SKY_BLUE_PREFIX}${service_filename[$i]} service has been started,pid:$(eval $pid)$COLOR_SUFFIX"
|
echo "${service_filename[$i]} service has been started,pid:$(eval $pid)"
|
||||||
echo -e "${SKY_BLUE_PREFIX}Killing the service ${service_filename[$i]} pid:$(eval $pid)${COLOR_SUFFIX}"
|
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 ../bin && echo -e "${SKY_BLUE_PREFIX}${service_filename[$i]} service is starting${COLOR_SUFFIX}"
|
cd ../bin
|
||||||
#Get the rpc port in the configuration file
|
#Get the rpc port in the configuration file
|
||||||
portList=$(cat $config_path | grep ${service_port_name[$i]} | awk -F '[:]' '{print $NF}')
|
portList=$(cat $config_path | grep ${service_port_name[$i]} | awk -F '[:]' '{print $NF}')
|
||||||
list_to_string ${portList}
|
list_to_string ${portList}
|
||||||
#Start related rpc services based on the number of ports
|
#Start related rpc services based on the number of ports
|
||||||
for j in ${ports_array}; do
|
for j in ${ports_array}; do
|
||||||
echo -e "${SKY_BLUE_PREFIX}${service_filename[$i]} Service is starting,port number:$j $COLOR_SUFFIX"
|
|
||||||
#Start the service in the background
|
#Start the service in the background
|
||||||
# ./${service_filename[$i]} -port $j &
|
# ./${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
|
sleep 1
|
||||||
pid="netstat -ntlp|grep $j |awk '{printf \$7}'|cut -d/ -f1"
|
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"
|
echo -e "${GREEN_PREFIX}${service_filename[$i]} start success,port number:$j pid:$(eval $pid)$COLOR_SUFFIX"
|
||||||
done
|
done
|
||||||
done
|
done
|
Loading…
x
Reference in New Issue
Block a user