aboutsummaryrefslogtreecommitdiffstats
path: root/priv/templates/extended_bin
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2019-04-12 14:32:04 -0600
committerGitHub <[email protected]>2019-04-12 14:32:04 -0600
commit4825a495febf31f5be172d1a7e9b89a1514f1b5c (patch)
tree5ad651baaf09bb73777a83645f60accc0e7d8d08 /priv/templates/extended_bin
parenta6107ec667820de9f6b6d6ae835b0f3b7e613a58 (diff)
downloadrelx-4825a495febf31f5be172d1a7e9b89a1514f1b5c.tar.gz
relx-4825a495febf31f5be172d1a7e9b89a1514f1b5c.tar.bz2
relx-4825a495febf31f5be172d1a7e9b89a1514f1b5c.zip
include dist and epmd arguments from vm.args in remote shell and nodetool calls (#710)v3.30.0
* remove unused VM_ARGS variable * include dist args in extended start scripts other calls
Diffstat (limited to 'priv/templates/extended_bin')
-rwxr-xr-xpriv/templates/extended_bin31
1 files changed, 26 insertions, 5 deletions
diff --git a/priv/templates/extended_bin b/priv/templates/extended_bin
index e224c62..cfeb859 100755
--- a/priv/templates/extended_bin
+++ b/priv/templates/extended_bin
@@ -176,7 +176,7 @@ relx_rem_sh() {
# Setup remote shell command to control node
exec "$BINDIR/erl" "$NAME_TYPE" "$id" -remsh "$NAME" -boot start_clean \
- -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
+ -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" $MAYBE_DIST_ARGS \
-setcookie "$COOKIE" -hidden -kernel net_ticktime $TICKTIME
}
@@ -189,8 +189,16 @@ relx_gen_id() {
relx_nodetool() {
command="$1"; shift
- "$ERTS_DIR/bin/escript" "$ROOTDIR/bin/nodetool" "$NAME_TYPE" "$NAME" \
- -setcookie "$COOKIE" "$command" $@
+ if [ -z "${START_EPMD}" ]; then
+ ERL_FLAGS="${ERL_FLAGS} ${MAYBE_DIST_ARGS}" "$ERTS_DIR/bin/escript" \
+ "$ROOTDIR/bin/nodetool" "$NAME_TYPE" "$NAME" \
+ -setcookie "$COOKIE" "$command" $@
+ else
+ ERL_FLAGS="${ERL_FLAGS} ${MAYBE_DIST_ARGS}" "$ERTS_DIR/bin/escript" \
+ "$ROOTDIR/bin/nodetool" "$NAME_TYPE" "$NAME" \
+ $START_EPMD -setcookie "$COOKIE" "$command" $@
+ fi
+
}
# Run an escript in the node's environment
@@ -454,6 +462,21 @@ NAME_ARG=$(eval echo "${NAME_ARG}")
NAME_TYPE="$(echo "$NAME_ARG" | awk '{print $1}')"
NAME="$(echo "$NAME_ARG" | awk '{print $2}')"
+# Extract dist arguments
+MAYBE_DIST_ARGS=""
+PROTO_DIST="$(grep '^-proto_dist' "$VMARGS_PATH" || true)"
+if [ "$PROTO_DIST" ]; then
+ MAYBE_DIST_ARGS="${PROTO_DIST}"
+fi
+START_EPMD="$(grep '^-start_epmd' "$VMARGS_PATH" || true)"
+if [ "$START_EPMD" ]; then
+ MAYBE_DIST_ARGS="${MAYBE_DIST_ARGS} ${START_EPMD}"
+fi
+EPMD_MODULE="$(grep '^-epmd_module' "$VMARGS_PATH" || true)"
+if [ "$EPMD_MODULE" ]; then
+ MAYBE_DIST_ARGS="${MAYBE_DIST_ARGS} ${EPMD_MODULE}"
+fi
+
# Extract the target cookie
# Do this before relx_get_nodename so we can use it and not create a ~/.erlang.cookie
COOKIE_ARG="$(grep '^-setcookie' "$VMARGS_PATH" || true)"
@@ -483,8 +506,6 @@ export NAME
test -z "$PIPE_DIR" && PIPE_BASE_DIR='/tmp/erl_pipes/'
PIPE_DIR="${PIPE_DIR:-/tmp/erl_pipes/$NAME/}"
-VM_ARGS="$(grep -v -E '^#|^-name|^-sname|^-setcookie|^-heart|^-args_file' "$VMARGS_PATH" | xargs | sed -e 's/ / /g')"
-
cd "$ROOTDIR"
# Check the first argument for instructions