Przeglądaj źródła

fix(scripts): Ensure ekka in ERL_LIBS for remote nodes

Zaiming Shi 5 lat temu
rodzic
commit
7bf5bb26e7
3 zmienionych plików z 3 dodań i 1 usunięć
  1. 1 0
      bin/emqx
  2. 1 1
      bin/emqx_ctl
  3. 1 0
      data/emqx_vars

+ 1 - 0
bin/emqx

@@ -176,6 +176,7 @@ relx_nodetool() {
     command="$1"; shift
     command="$1"; shift
 
 
     ERL_FLAGS="$ERL_FLAGS $EPMD_ARG" \
     ERL_FLAGS="$ERL_FLAGS $EPMD_ARG" \
+    ERL_LIBS="${LIB_EKKA_DIR}:${ERL_LIBS:-}" \
     "$ERTS_DIR/bin/escript" "$ROOTDIR/bin/nodetool" "$NAME_TYPE" "$NAME" \
     "$ERTS_DIR/bin/escript" "$ROOTDIR/bin/nodetool" "$NAME_TYPE" "$NAME" \
                                 -setcookie "$COOKIE" "$command" "$@"
                                 -setcookie "$COOKIE" "$command" "$@"
 }
 }

+ 1 - 1
bin/emqx_ctl

@@ -27,11 +27,11 @@ relx_nodetool() {
     command="$1"; shift
     command="$1"; shift
 
 
     ERL_FLAGS="$ERL_FLAGS $EPMD_ARG $PROTO_DIST_ARG" \
     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" \
     "$ERTS_DIR/bin/escript" "$ROOTDIR/bin/nodetool" "$NAME_TYPE" "$NAME" \
                                 -setcookie "$COOKIE" "$command" "$@"
                                 -setcookie "$COOKIE" "$command" "$@"
 }
 }
 
 
-
 if [ -z "$NAME_ARG" ]; then
 if [ -z "$NAME_ARG" ]; then
     NODENAME="${EMQX_NODE_NAME:-}"
     NODENAME="${EMQX_NODE_NAME:-}"
     # check if there is a node running, inspect its name
     # check if there is a node running, inspect its name

+ 1 - 0
data/emqx_vars

@@ -14,6 +14,7 @@ RUNNER_ETC_DIR="{{ runner_etc_dir }}"
 RUNNER_DATA_DIR="{{ runner_data_dir }}"
 RUNNER_DATA_DIR="{{ runner_data_dir }}"
 RUNNER_USER="{{ runner_user }}"
 RUNNER_USER="{{ runner_user }}"
 EMQX_DISCR="{{ emqx_description }}"
 EMQX_DISCR="{{ emqx_description }}"
+LIB_EKKA_DIR="${RUNNER_LIB_DIR}/ekka-$(grep ekka "${RUNNER_ROOT_DIR}/releases/RELEASES" | awk -F '\"' '{print $2}')"
 
 
 ## computed vars
 ## computed vars
 REL_NAME="emqx"
 REL_NAME="emqx"