mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-28 06:22:12 +08:00
feat: add more module explain
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
parent
5424129163
commit
ca543df323
@ -76,7 +76,7 @@ scripts/
|
|||||||
├── msg_gateway_start.sh # Script to start message gateway service
|
├── msg_gateway_start.sh # Script to start message gateway service
|
||||||
├── msg_transfer_start.sh # Script to start message transfer service
|
├── msg_transfer_start.sh # Script to start message transfer service
|
||||||
├── path_info.sh # Script containing path information
|
├── path_info.sh # Script containing path information
|
||||||
├── push_start.sh # Script to start push service
|
├── openim-push.sh # Script to start push service
|
||||||
├── release.sh # Script to perform release process
|
├── release.sh # Script to perform release process
|
||||||
├── start_all.sh # Script to start all services
|
├── start_all.sh # Script to start all services
|
||||||
├── openim-crontask.sh # Script to start cron jobs
|
├── openim-crontask.sh # Script to start cron jobs
|
||||||
@ -264,6 +264,10 @@ openim::util::stop_services_with_name nginx apache
|
|||||||
## examples
|
## examples
|
||||||
Scripts to perform various build, install, analysis, etc operations.
|
Scripts to perform various build, install, analysis, etc operations.
|
||||||
|
|
||||||
|
The script directory design of OpenIM and the writing of scripts and tools refer to many excellent open source projects, such as helm, iam, kubernetes, docker, etc.
|
||||||
|
|
||||||
|
Maybe they'll give you inspiration for later maintenance...
|
||||||
|
|
||||||
These scripts keep the root level Makefile small and simple.
|
These scripts keep the root level Makefile small and simple.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|||||||
@ -28,7 +28,7 @@ trap 'openim::util::onCtrlC' INT
|
|||||||
need_to_start_server_shell=(
|
need_to_start_server_shell=(
|
||||||
"start_rpc_service.sh"
|
"start_rpc_service.sh"
|
||||||
"msg_gateway_start.sh"
|
"msg_gateway_start.sh"
|
||||||
"push_start.sh"
|
"openim-push.sh"
|
||||||
"msg_transfer_start.sh"
|
"msg_transfer_start.sh"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ trap 'openim::util::onCtrlC' INT
|
|||||||
need_to_start_server_shell=(
|
need_to_start_server_shell=(
|
||||||
${SCRIPTS_ROOT}/start_rpc_service.sh
|
${SCRIPTS_ROOT}/start_rpc_service.sh
|
||||||
${SCRIPTS_ROOT}/msg_gateway_start.sh
|
${SCRIPTS_ROOT}/msg_gateway_start.sh
|
||||||
${SCRIPTS_ROOT}/push_start.sh
|
${SCRIPTS_ROOT}/openim-push.sh
|
||||||
${SCRIPTS_ROOT}/msg_transfer_start.sh
|
${SCRIPTS_ROOT}/msg_transfer_start.sh
|
||||||
${SCRIPTS_ROOT}/openim-crontask.sh
|
${SCRIPTS_ROOT}/openim-crontask.sh
|
||||||
)
|
)
|
||||||
|
|||||||
@ -17,5 +17,5 @@
|
|||||||
OPENIM_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. && pwd -P)
|
OPENIM_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. && pwd -P)
|
||||||
[[ -z ${COMMON_SOURCED} ]] && source ${OPENIM_ROOT}/scripts/install/common.sh
|
[[ -z ${COMMON_SOURCED} ]] && source ${OPENIM_ROOT}/scripts/install/common.sh
|
||||||
|
|
||||||
# common.sh environment.sh mariadb_for_ubuntu.sh msg_transfer_start.sh push_start.sh start_rpc_service.sh vimrc
|
# common.sh environment.sh mariadb_for_ubuntu.sh msg_transfer_start.sh openim-push.sh start_rpc_service.sh
|
||||||
# dependency.sh install.sh msg_gateway_start.sh openim-crontask.sh redis_for_ubuntu.sh test.sh
|
# dependency.sh install.sh msg_gateway_start.sh openim-crontask.sh redis_for_ubuntu.sh test.sh man.sh
|
||||||
0
scripts/install/man.sh
Normal file → Executable file
0
scripts/install/man.sh
Normal file → Executable file
@ -29,11 +29,11 @@
|
|||||||
# Usage:
|
# Usage:
|
||||||
# 1. Direct Script Execution:
|
# 1. Direct Script Execution:
|
||||||
# This will start the OpenIM CronTask directly through a background process.
|
# This will start the OpenIM CronTask directly through a background process.
|
||||||
# Example: ./[script-name].sh
|
# Example: ./openim-crontask.sh
|
||||||
#
|
#
|
||||||
# 2. Controlling through Functions for systemctl operations:
|
# 2. Controlling through Functions for systemctl operations:
|
||||||
# Specific operations like installation, uninstallation, and status check can be executed by passing the respective function name as an argument to the script.
|
# Specific operations like installation, uninstallation, and status check can be executed by passing the respective function name as an argument to the script.
|
||||||
# Example: ./[script-name].sh openim::crontask::install
|
# Example: ./openim-crontask.sh openim::crontask::install
|
||||||
#
|
#
|
||||||
# Note: Ensure that the appropriate permissions and environmental variables are set prior to script execution.
|
# Note: Ensure that the appropriate permissions and environmental variables are set prior to script execution.
|
||||||
#
|
#
|
||||||
|
|||||||
@ -12,7 +12,30 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
# OpenIM Push Control Script
|
||||||
|
#
|
||||||
|
# Description:
|
||||||
|
# This script provides a control interface for the OpenIM Push service within a Linux environment. It supports two installation methods: installation via function calls to systemctl, and direct installation through background processes.
|
||||||
|
#
|
||||||
|
# Features:
|
||||||
|
# 1. Robust error handling leveraging Bash built-ins such as 'errexit', 'nounset', and 'pipefail'.
|
||||||
|
# 2. Capability to source common utility functions and configurations, ensuring environmental consistency.
|
||||||
|
# 3. Comprehensive logging tools, offering clear operational insights.
|
||||||
|
# 4. Support for creating, managing, and interacting with Linux systemd services.
|
||||||
|
# 5. Mechanisms to verify the successful running of the service.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# 1. Direct Script Execution:
|
||||||
|
# This will start the OpenIM push directly through a background process.
|
||||||
|
# Example: ./openim-push.sh
|
||||||
|
#
|
||||||
|
# 2. Controlling through Functions for systemctl operations:
|
||||||
|
# Specific operations like installation, uninstallation, and status check can be executed by passing the respective function name as an argument to the script.
|
||||||
|
# Example: ./openim-push.sh openim::push::install
|
||||||
|
#
|
||||||
|
# Note: Ensure that the appropriate permissions and environmental variables are set prior to script execution.
|
||||||
|
#
|
||||||
set -o errexit
|
set -o errexit
|
||||||
set +o nounset
|
set +o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
@ -22,14 +45,14 @@ OPENIM_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. && pwd -P)
|
|||||||
|
|
||||||
SERVER_NAME="openim-push"
|
SERVER_NAME="openim-push"
|
||||||
|
|
||||||
# openim::log::status "Start OpenIM Push, binary root: ${SERVER_NAME}"
|
openim::log::status "Start OpenIM Push, binary root: ${SERVER_NAME}"
|
||||||
# openim::log::info "Start OpenIM Push, path: ${OPENIM_PUSH_BINARY}"
|
openim::log::info "Start OpenIM Push, path: ${OPENIM_PUSH_BINARY}"
|
||||||
|
|
||||||
# openim::util::stop_services_with_name ${SERVER_NAME}
|
openim::util::stop_services_with_name ${SERVER_NAME}
|
||||||
|
|
||||||
# openim::log::status "start push process, path: ${OPENIM_PUSH_BINARY}"
|
openim::log::status "start push process, path: ${OPENIM_PUSH_BINARY}"
|
||||||
# nohup ${OPENIM_PUSH_BINARY} >>${LOG_FILE} 2>&1 &
|
nohup ${OPENIM_PUSH_BINARY} >>${LOG_FILE} 2>&1 &
|
||||||
# openim::util::check_process_names ${SERVER_NAME}
|
openim::util::check_process_names ${SERVER_NAME}
|
||||||
|
|
||||||
###################################### Linux Systemd ######################################
|
###################################### Linux Systemd ######################################
|
||||||
SYSTEM_FILE_PATH="/etc/systemd/system/${SERVER_NAME}.service"
|
SYSTEM_FILE_PATH="/etc/systemd/system/${SERVER_NAME}.service"
|
||||||
@ -109,13 +132,6 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
cd $SCRIPTS_ROOT
|
|
||||||
|
|
||||||
bin_dir="$BIN_DIR"
|
|
||||||
logs_dir="$OPENIM_ROOT/logs"
|
|
||||||
|
|
||||||
cd "$OPENIM_ROOT/scripts/"
|
|
||||||
|
|
||||||
list1=$(cat $config_path | grep openImPushPort | awk -F '[:]' '{print $NF}')
|
list1=$(cat $config_path | grep openImPushPort | awk -F '[:]' '{print $NF}')
|
||||||
list2=$(cat $config_path | grep pushPrometheusPort | awk -F '[:]' '{print $NF}')
|
list2=$(cat $config_path | grep pushPrometheusPort | awk -F '[:]' '{print $NF}')
|
||||||
openim::util::list-to-string $list1
|
openim::util::list-to-string $list1
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Copyright © 2023 OpenIM. All rights reserved.
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
# The golang package that we are building.
|
# The golang package that we are building.
|
||||||
OPENIM_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)"
|
OPENIM_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)"
|
||||||
readonly KUBE_GO_PACKAGE=github.com/openimsdk/open-im-server
|
readonly KUBE_GO_PACKAGE=github.com/openimsdk/open-im-server
|
||||||
@ -95,7 +96,7 @@ START_SCRIPTS_PATH="${OPENIM_ROOT}/scripts/install/"
|
|||||||
openim::golang::start_script_list() {
|
openim::golang::start_script_list() {
|
||||||
local targets=(
|
local targets=(
|
||||||
start-rpc_service.sh
|
start-rpc_service.sh
|
||||||
push_start.sh
|
openim-push.sh
|
||||||
msg_transfer_start.sh
|
msg_transfer_start.sh
|
||||||
msg_gateway_start.sh
|
msg_gateway_start.sh
|
||||||
openim-crontask.sh
|
openim-crontask.sh
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user