mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-19 04:37:01 +08:00
815
Signed-off-by: hanzhixiao <709674996@qq.com>
This commit is contained in:
parent
3e312a58ec
commit
e2bf7845c3
@ -23,6 +23,7 @@ OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
|
||||
#fixme Put the shell scripts name here
|
||||
need_to_start_server_shell=(
|
||||
${SCRIPTS_ROOT}/start_component_check.sh
|
||||
${SCRIPTS_ROOT}/start_rpc_service.sh
|
||||
${SCRIPTS_ROOT}/msg_gateway_start.sh
|
||||
${SCRIPTS_ROOT}/push_start.sh
|
||||
|
||||
@ -40,6 +40,19 @@ declare -A supported_architectures=(
|
||||
["darwin-x86_64"]="_output/bin/platforms/darwin/amd64" # Alias for darwin-amd64
|
||||
)
|
||||
|
||||
declare -A supported_architectures_tools=(
|
||||
["linux-amd64"]="_output/bin-tools/platforms/linux/amd64"
|
||||
["linux-arm64"]="_output/bin-tools/platforms/linux/arm64"
|
||||
["linux-mips64"]="_output/bin-tools/platforms/linux/mips64"
|
||||
["linux-mips64le"]="_output/bin-tools/platforms/linux/mips64le"
|
||||
["linux-ppc64le"]="_output/bin-tools/platforms/linux/ppc64le"
|
||||
["linux-s390x"]="_output/bin-tools/platforms/linux/s390x"
|
||||
["darwin-amd64"]="_output/bin-tools/platforms/darwin/amd64"
|
||||
["windows-amd64"]="_output/bin-tools/platforms/windows/amd64"
|
||||
["linux-x86_64"]="_output/bin-tools/platforms/linux/amd64" # Alias for linux-amd64
|
||||
["darwin-x86_64"]="_output/bin-tools/platforms/darwin/amd64" # Alias for darwin-amd64
|
||||
)
|
||||
|
||||
# Check if the architecture and version are supported
|
||||
if [[ -z ${supported_architectures["$version-$architecture"]} ]]; then
|
||||
echo -e "${BLUE_PREFIX}================> Unsupported architecture: $architecture or version: $version${COLOR_SUFFIX}"
|
||||
@ -50,6 +63,7 @@ echo -e "${BLUE_PREFIX}================> Architecture: $architecture${COLOR_SUFF
|
||||
|
||||
# Set the BIN_DIR based on the architecture and version
|
||||
BIN_DIR=${supported_architectures["$version-$architecture"]}
|
||||
BIN_DIR_TOOLS=${supported_architectures["$version-$architecture"]}
|
||||
|
||||
echo -e "${BLUE_PREFIX}================> BIN_DIR: $OPENIM_ROOT/$BIN_DIR${COLOR_SUFFIX}"
|
||||
|
||||
@ -84,6 +98,10 @@ config_path="$OPENIM_ROOT/config/config.yaml"
|
||||
configfile_path="$OPENIM_ROOT/config"
|
||||
log_path="$OPENIM_ROOT/log"
|
||||
|
||||
|
||||
component_check="component"
|
||||
component_check_binary_root="$OPENIM_ROOT/$BIN_DIR_TOOLS"
|
||||
|
||||
# servicefile dir path
|
||||
service_source_root=(
|
||||
# api service file
|
||||
|
||||
50
scripts/start_component_check.sh
Normal file
50
scripts/start_component_check.sh
Normal file
@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright © 2023 OpenIM. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
#Include shell font styles and some basic information
|
||||
SCRIPTS_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
|
||||
#Include shell font styles and some basic information
|
||||
source $SCRIPTS_ROOT/style_info.sh
|
||||
source $SCRIPTS_ROOT/path_info.sh
|
||||
source $SCRIPTS_ROOT/function.sh
|
||||
|
||||
echo -e "${YELLOW_PREFIX}=======>SCRIPTS_ROOT=$SCRIPTS_ROOT${COLOR_SUFFIX}"
|
||||
echo -e "${YELLOW_PREFIX}=======>OPENIM_ROOT=$OPENIM_ROOT${COLOR_SUFFIX}"
|
||||
echo -e "${YELLOW_PREFIX}=======>pwd=$PWD${COLOR_SUFFIX}"
|
||||
|
||||
bin_dir="$BIN_DIR"
|
||||
logs_dir="$OPENIM_ROOT/logs"
|
||||
|
||||
cd $OPENIM_ROOT
|
||||
|
||||
#Check if the service exists
|
||||
#If it is exists,kill this process
|
||||
check=`ps | grep -w ./${openim_msgtransfer} | grep -v grep| wc -l`
|
||||
if [ $check -ge 1 ]
|
||||
then
|
||||
oldPid=`ps | grep -w ./${openim_msgtransfer} | grep -v grep|awk '{print $2}'`
|
||||
kill -9 $oldPid
|
||||
fi
|
||||
#Waiting port recycling
|
||||
sleep 1
|
||||
|
||||
cd ${component_check_binary_root}
|
||||
cmd="nohup ./${component_check}"
|
||||
echo "==========================start components checking===========================">>$OPENIM_ROOT/logs/openIM.log
|
||||
$cmd >>$OPENIM_ROOT/logs/openIM.log 2>&1 &
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user