mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-02 18:34:29 +08:00
fix: fix the script
This commit is contained in:
parent
83ee01acfd
commit
5fb5a1fc07
@ -48,5 +48,5 @@ func ExitWithError(err error) {
|
||||
|
||||
func SIGTERMExit() {
|
||||
progName := filepath.Base(os.Args[0])
|
||||
fmt.Fprintf(os.Stderr, "Warning %s receive process terminal SIGTERM exit 0", progName)
|
||||
fmt.Fprintf(os.Stderr, "Warning %s receive process terminal SIGTERM exit 0\n", progName)
|
||||
}
|
||||
|
||||
@ -108,38 +108,6 @@ function openim::msgtransfer::check_by_signal() {
|
||||
fi
|
||||
}
|
||||
|
||||
function openim::msgtransfer::check_by_signal() {
|
||||
PIDS=$(pgrep -f "${OPENIM_OUTPUT_HOSTBIN}/openim-msgtransfer")
|
||||
if [ -z "$PIDS" ]; then
|
||||
openim::log::success "All openim-msgtransfer processes have been stopped properly."
|
||||
return 0
|
||||
fi
|
||||
|
||||
openim::log::error "Found processes for $OPENIM_OUTPUT_HOSTBIN/openim-msgtransfer:"
|
||||
for PID in $PIDS; do
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
# Extract details for Linux
|
||||
details=$(ps -p $PID -o pid,comm,lstart= | awk 'NR>1 {print $1, $2, $3, $4, $5, $6, $7}')
|
||||
command=$(echo $details | awk '{print $2}')
|
||||
start_time=$(echo $details | awk '{print $3, $4, $5, $6, $7}')
|
||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
# Handle details extraction for macOS
|
||||
details=$(ps -p $PID -o pid,comm,start= | awk 'NR>1 {print $1, $2, $3}')
|
||||
command=$(echo $details | awk '{print $2}')
|
||||
start_time=$(echo $details | awk '{print $3}')
|
||||
else
|
||||
openim::log::error "Unsupported OS type: $OSTYPE"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Assuming FD and port number are not directly retrievable for msgtransfer processes
|
||||
openim::log::error "PID: $PID - Command: $command, Started: $start_time"
|
||||
done
|
||||
|
||||
openim::log::success "Processes have not been stopped properly."
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
function openim::msgtransfer::check_by_signal1() {
|
||||
PIDS=$(pgrep -f "${OPENIM_OUTPUT_HOSTBIN}/openim-msgtransfer")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user