diff --git a/bin/emqx b/bin/emqx index d21a234f2..37ad53f48 100755 --- a/bin/emqx +++ b/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"