From 08da5f526713e3cd596d608094cdefb0bbd01042 Mon Sep 17 00:00:00 2001 From: Shawn <506895667@qq.com> Date: Tue, 21 Dec 2021 16:53:06 +0800 Subject: [PATCH] fix(boot_script): LD_LIBRARY_PATH: unbound variable --- bin/emqx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/emqx b/bin/emqx index 7862a98b8..b5f7a1903 100755 --- a/bin/emqx +++ b/bin/emqx @@ -204,7 +204,10 @@ fi if ! check_erlang_start >/dev/null 2>&1; then BUILT_ON="$(head -1 "${REL_DIR}/BUILT_ON")" ## failed to start, might be due to missing libs, try to be portable - export LD_LIBRARY_PATH="$DYNLIBS_DIR:$LD_LIBRARY_PATH" + export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:-$DYNLIBS_DIR}" + if [ "$LD_LIBRARY_PATH" != "$DYNLIBS_DIR" ]; then + export LD_LIBRARY_PATH="$DYNLIBS_DIR:$LD_LIBRARY_PATH" + fi if ! check_erlang_start; then ## it's hopeless echoerr "FATAL: Unable to start Erlang."