|
|
@ -16,18 +16,9 @@
|
|
|
|
#FIXME This script is the startup script for multiple servers.
|
|
|
|
#FIXME This script is the startup script for multiple servers.
|
|
|
|
#FIXME The full names of the shell scripts that need to be started are placed in the `need_to_start_server_shell` array.
|
|
|
|
#FIXME The full names of the shell scripts that need to be started are placed in the `need_to_start_server_shell` array.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
|
|
|
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
|
|
|
source "${OPENIM_ROOT}/scripts/install/common.sh"
|
|
|
|
source "${OPENIM_ROOT}/scripts/install/common.sh"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Function to execute the scripts.
|
|
|
|
# Function to execute the scripts.
|
|
|
|
function execute_start_scripts() {
|
|
|
|
function execute_start_scripts() {
|
|
|
|
for script_path in "${OPENIM_SERVER_SCRIPT_START_LIST[@]}"; do
|
|
|
|
for script_path in "${OPENIM_SERVER_SCRIPT_START_LIST[@]}"; do
|
|
|
@ -58,37 +49,29 @@ function execute_start_scripts() {
|
|
|
|
done
|
|
|
|
done
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if openim::util::is_running_in_container; then
|
|
|
|
if openim::util::is_running_in_container; then
|
|
|
|
exec >> ${DOCKER_LOG_FILE} 2>&1
|
|
|
|
exec >> ${DOCKER_LOG_FILE} 2>&1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
openim::golang::check_openim_binaries
|
|
|
|
openim::golang::check_openim_binaries
|
|
|
|
if [[ $? -ne 0 ]]; then
|
|
|
|
if [[ $? -ne 0 ]]; then
|
|
|
|
openim::log::error "OpenIM binaries are not found. Please run 'make build' to build binaries."
|
|
|
|
openim::log::error "OpenIM binaries are not found. Please run 'make build' to build binaries."
|
|
|
|
"${OPENIM_ROOT}"/scripts/build-all-service.sh
|
|
|
|
"${OPENIM_ROOT}"/scripts/build-all-service.sh
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"${OPENIM_ROOT}"/scripts/init-config.sh --skip
|
|
|
|
"${OPENIM_ROOT}"/scripts/init-config.sh --skip
|
|
|
|
|
|
|
|
|
|
|
|
#openim::log::print_blue "Execute the following script in sequence: ${OPENIM_SERVER_SCRIPTARIES[@]}"
|
|
|
|
#openim::log::print_blue "Execute the following script in sequence: ${OPENIM_SERVER_SCRIPTARIES[@]}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# TODO Prelaunch tools, simple for now, can abstract functions later
|
|
|
|
# TODO Prelaunch tools, simple for now, can abstract functions later
|
|
|
|
TOOLS_START_SCRIPTS_PATH=${START_SCRIPTS_PATH}/openim-tools.sh
|
|
|
|
TOOLS_START_SCRIPTS_PATH=${START_SCRIPTS_PATH}/openim-tools.sh
|
|
|
|
|
|
|
|
|
|
|
|
openim::log::status "Start the pre-start tools:"
|
|
|
|
openim::log::status "Start the pre-start tools:"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# if ! ${TOOLS_START_SCRIPTS_PATH} openim::tools::pre-start; then
|
|
|
|
if ! ${TOOLS_START_SCRIPTS_PATH} openim::tools::pre-start; then
|
|
|
|
# openim::log::error "Start the pre-start tools, aborting!"
|
|
|
|
openim::log::error "Start the pre-start tools, aborting!"
|
|
|
|
# exit 1
|
|
|
|
exit 1
|
|
|
|
# fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
openim::log::colorless "pre-start has been successfully completed!"
|
|
|
|
openim::log::colorless "pre-start has been successfully completed!"
|
|
|
@ -119,11 +102,8 @@ if [[ $? -ne 0 ]]; then
|
|
|
|
exit 1
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
openim::log::status "Start the post-start tools:"
|
|
|
|
openim::log::status "Start the post-start tools:"
|
|
|
|
${TOOLS_START_SCRIPTS_PATH} openim::tools::post-start
|
|
|
|
# ${TOOLS_START_SCRIPTS_PATH} openim::tools::post-start
|
|
|
|
openim::log::status "post-start has been successfully completed!"
|
|
|
|
openim::log::status "post-start has been successfully completed!"
|
|
|
|
openim::util::find_ports_for_all_services ${OPENIM_ALL_SERVICE_LIBRARIES_NO_TRANSFER[@]}
|
|
|
|
openim::util::find_ports_for_all_services ${OPENIM_ALL_SERVICE_LIBRARIES_NO_TRANSFER[@]}
|
|
|
|
openim::util::find_ports_for_all_services ${OPENIM_MSGTRANSFER_BINARY[@]}
|
|
|
|
openim::util::find_ports_for_all_services ${OPENIM_MSGTRANSFER_BINARY[@]}
|
|
|
|