mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-02 18:34:29 +08:00
fix: fix the msgtranfer script
This commit is contained in:
parent
64a3666055
commit
42ad29bfdf
@ -70,15 +70,15 @@ else
|
||||
fi
|
||||
|
||||
openim::log::info "\n## Check OpenIM service name"
|
||||
. $(dirname ${BASH_SOURCE})/install/openim-msgtransfer.sh openim::msgtransfer::check
|
||||
. $(dirname ${BASH_SOURCE})/install/openim-msgtransfer.sh openim::msgtransfer::check_by_signal
|
||||
|
||||
openim::log::info "\n## Check all OpenIM service ports"
|
||||
echo "+++ The port being checked: ${OPENIM_SERVER_PORT_LISTARIES[@]}"
|
||||
openim::util::check_ports_by_signal ${OPENIM_SERVER_PORT_LISTARIES[@]}
|
||||
if [[ $? -eq 0 ]]; then
|
||||
openim::log::error_exit "The service does not stop properly, there are still processes running, please check the port, query variable definition!"
|
||||
else
|
||||
echo "+++ cat openim log file >>> ${LOG_FILE}"
|
||||
openim::log::error_exit "The service does not stop properly, there are still processes running, please check!"
|
||||
else
|
||||
echo "++++ All openim service ports stop successfully !"
|
||||
fi
|
||||
|
||||
|
||||
@ -88,6 +88,27 @@ function openim::msgtransfer::check() {
|
||||
fi
|
||||
}
|
||||
|
||||
function openim::msgtransfer::check_by_signal() {
|
||||
PIDS=$(pgrep -f "${OPENIM_OUTPUT_HOSTBIN}/openim-msgtransfer")
|
||||
NUM_PROCESSES=$(echo "$PIDS" | wc -l | xargs)
|
||||
|
||||
if [ "$NUM_PROCESSES" -gt 0 ]; then
|
||||
openim::log::info "Found $NUM_PROCESSES processes for $OPENIM_OUTPUT_HOSTBIN/openim-msgtransfer"
|
||||
for PID in $PIDS; do
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
ps -p $PID -o pid,cmd
|
||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
ps -p $PID -o pid,comm
|
||||
else
|
||||
openim::log::error "Unsupported OS type: $OSTYPE"
|
||||
fi
|
||||
done
|
||||
openim::log::error "Processes have not been stopped properly."
|
||||
else
|
||||
openim::log::success "All openim-msgtransfer processes have been stopped properly."
|
||||
fi
|
||||
}
|
||||
|
||||
###################################### Linux Systemd ######################################
|
||||
SYSTEM_FILE_PATH="/etc/systemd/system/${SERVER_NAME}.service"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user