fix: bin/emqx change use ps -p to check if pid is running
This commit is contained in:
parent
cd92f73ca1
commit
1a80b9dc47
7
bin/emqx
7
bin/emqx
|
@ -302,9 +302,11 @@ bootstrapd() {
|
|||
# check if a PID is down
|
||||
is_down() {
|
||||
PID="$1"
|
||||
if kill -s 0 "$PID" 2>/dev/null; then
|
||||
if ps -p "$PID" >/dev/null; then
|
||||
# still alive
|
||||
return 1
|
||||
fi
|
||||
# it's gone
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -484,7 +486,8 @@ case "$1" in
|
|||
exit 1
|
||||
fi
|
||||
WAIT_TIME="${WAIT_FOR_ERLANG_STOP:-60}"
|
||||
if ! wait_for "$WAIT_TIME" is_down "$PID"; then
|
||||
if ! wait_for "$WAIT_TIME" 'is_down' "$PID"; then
|
||||
ps -p "$PID"
|
||||
msg="dangling after ${WAIT_TIME} seconds"
|
||||
# also log to syslog
|
||||
logger -t "${REL_NAME}[${PID}]" "STOP: $msg"
|
||||
|
|
Loading…
Reference in New Issue