Merge pull request #12273 from zmstone/0108-emqx-11692-no-crash-log-if-start-command-timeout

fix(bin/emqx): check app status in bash script
This commit is contained in:
Zaiming (Stone) Shi 2024-01-08 19:38:06 +00:00 committed by GitHub
commit ea942d335e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -988,6 +988,7 @@ fi
diagnose_boot_failure_and_die() { diagnose_boot_failure_and_die() {
local ps_line local ps_line
local app_status
ps_line="$(find_emqx_process)" ps_line="$(find_emqx_process)"
if [ -z "$ps_line" ]; then if [ -z "$ps_line" ]; then
echo "Find more information in the latest log file: ${EMQX_LOG_DIR}/erlang.log.*" echo "Find more information in the latest log file: ${EMQX_LOG_DIR}/erlang.log.*"
@ -999,9 +1000,9 @@ diagnose_boot_failure_and_die() {
pipe_shutdown pipe_shutdown
exit 2 exit 2
fi fi
if ! relx_nodetool 'eval' 'true = emqx:is_running()' > /dev/null; then app_status="$(relx_nodetool 'eval' 'emqx:is_running()')"
if [ "$app_status" != 'true' ]; then
logerr "$NAME node is started, but failed to complete the boot sequence in time." logerr "$NAME node is started, but failed to complete the boot sequence in time."
echo "Please collect the logs in ${EMQX_LOG_DIR} and report a bug to EMQX team at https://github.com/emqx/emqx/issues/new/choose"
pipe_shutdown pipe_shutdown
exit 3 exit 3
fi fi