From 7bf5bb26e7a4ec28b233c8d0e9e3a45d672f2f28 Mon Sep 17 00:00:00 2001 From: Zaiming Shi Date: Tue, 2 Mar 2021 11:08:13 +0100 Subject: [PATCH] fix(scripts): Ensure ekka in ERL_LIBS for remote nodes --- bin/emqx | 1 + bin/emqx_ctl | 2 +- data/emqx_vars | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/emqx b/bin/emqx index 2fe24af23..81b1a9594 100755 --- a/bin/emqx +++ b/bin/emqx @@ -176,6 +176,7 @@ relx_nodetool() { command="$1"; shift ERL_FLAGS="$ERL_FLAGS $EPMD_ARG" \ + ERL_LIBS="${LIB_EKKA_DIR}:${ERL_LIBS:-}" \ "$ERTS_DIR/bin/escript" "$ROOTDIR/bin/nodetool" "$NAME_TYPE" "$NAME" \ -setcookie "$COOKIE" "$command" "$@" } diff --git a/bin/emqx_ctl b/bin/emqx_ctl index 961832c86..5fa35c7a5 100755 --- a/bin/emqx_ctl +++ b/bin/emqx_ctl @@ -27,11 +27,11 @@ relx_nodetool() { command="$1"; shift ERL_FLAGS="$ERL_FLAGS $EPMD_ARG $PROTO_DIST_ARG" \ + ERL_LIBS="${LIB_EKKA_DIR}:${ERL_LIBS:-}" \ "$ERTS_DIR/bin/escript" "$ROOTDIR/bin/nodetool" "$NAME_TYPE" "$NAME" \ -setcookie "$COOKIE" "$command" "$@" } - if [ -z "$NAME_ARG" ]; then NODENAME="${EMQX_NODE_NAME:-}" # check if there is a node running, inspect its name diff --git a/data/emqx_vars b/data/emqx_vars index 2266f741b..5159fa246 100644 --- a/data/emqx_vars +++ b/data/emqx_vars @@ -14,6 +14,7 @@ RUNNER_ETC_DIR="{{ runner_etc_dir }}" RUNNER_DATA_DIR="{{ runner_data_dir }}" RUNNER_USER="{{ runner_user }}" EMQX_DISCR="{{ emqx_description }}" +LIB_EKKA_DIR="${RUNNER_LIB_DIR}/ekka-$(grep ekka "${RUNNER_ROOT_DIR}/releases/RELEASES" | awk -F '\"' '{print $2}')" ## computed vars REL_NAME="emqx"