mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 02:42:19 +08:00
fix: fix the scripts
This commit is contained in:
parent
9cea45bf96
commit
7fff4aeabe
@ -29,7 +29,8 @@ source "${OPENIM_ROOT}/scripts/install/common.sh"
|
||||
OPENIM_VERBOSE=4
|
||||
|
||||
openim::log::info "\n# Begin to check all openim service"
|
||||
. $(dirname ${BASH_SOURCE})/install/openim-msgtransfer.sh openim::msgtransfer::check_by_signal || ture
|
||||
. $(dirname ${BASH_SOURCE})/install/openim-msgtransfer.sh openim::msgtransfer::check_by_signal
|
||||
openim::log::info "\n# to check all openim service、nnnnnnnnnnnnnn"
|
||||
|
||||
handle_error() {
|
||||
echo "An error occurred. Printing ${STDERR_LOG_FILE} contents:"
|
||||
@ -40,11 +41,6 @@ trap handle_error ERR
|
||||
|
||||
echo "Check ports:"
|
||||
openim::util::check_ports_by_signal ${OPENIM_SERVER_PORT_LISTARIES[@]}
|
||||
if [[ $? -ne 0 ]]; then
|
||||
openim::log::error "The service does not stop properly, there are still processes running, please check!"
|
||||
else
|
||||
openim::log::success "++++ All openim service ports stop successfully !"
|
||||
fi
|
||||
|
||||
|
||||
set -e
|
||||
|
||||
@ -88,16 +88,18 @@ function openim::msgtransfer::check() {
|
||||
}
|
||||
|
||||
function openim::msgtransfer::check_by_signal() {
|
||||
PIDS=$(pgrep -f "${OPENIM_OUTPUT_HOSTBIN}/openim-msgtransfer")
|
||||
PIDS=$(pgrep -f "${OPENIM_OUTPUT_HOSTBIN}/openim-msgtransfer") || PIDS="0"
|
||||
if [ "$PIDS" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
NUM_PROCESSES=$(echo "$PIDS" | wc -l | xargs)
|
||||
|
||||
echo "1111111111111"
|
||||
if [ "$NUM_PROCESSES" -gt 0 ]; then
|
||||
openim::log::error "Found $NUM_PROCESSES processes for $OPENIM_OUTPUT_HOSTBIN/openim-msgtransfer"
|
||||
for PID in $PIDS; do
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
echo -e "\033[31m$(ps -p $PID -o pid,cmd)\033[0m"
|
||||
ps -p $PID -o pid,cmd
|
||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
echo -e "\033[31m$(ps -p $PID -o pid,comm)\033[0m"
|
||||
else
|
||||
@ -108,7 +110,6 @@ function openim::msgtransfer::check_by_signal() {
|
||||
else
|
||||
openim::log::success "All openim-msgtransfer processes have been stopped properly."
|
||||
fi
|
||||
echo "2222222222222"
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
@ -440,10 +440,8 @@ openim::util::check_ports_by_signal() {
|
||||
# If any of the processes is not running, return a status of 1.
|
||||
if [[ ${#not_started[@]} -ne 0 ]]; then
|
||||
openim::log::success "All specified processes are running."
|
||||
return 0
|
||||
else
|
||||
openim::log::error "Have processes no stop."
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user