From 8ff1e44cebf3aee09969a9324c04074ba87f10b9 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sun, 14 Apr 2019 07:21:04 -0600 Subject: add dist name and cookie to ERL_FLAGS for nodetool (#712) * remove deprecated hex field from .app.src * start nodetool dist node in erl flags --- priv/templates/extended_bin | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'priv/templates/extended_bin') diff --git a/priv/templates/extended_bin b/priv/templates/extended_bin index cfeb859..a4cba4a 100755 --- a/priv/templates/extended_bin +++ b/priv/templates/extended_bin @@ -189,16 +189,22 @@ relx_gen_id() { relx_nodetool() { command="$1"; shift + # Generate a unique id used to allow multiple nodetool calls to the + # same node transparently + nodetool_id="maint$(relx_gen_id)-${NAME}" + 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" $@ + ERL_FLAGS="${ERL_FLAGS} ${MAYBE_DIST_ARGS} ${NAME_TYPE} $nodetool_id -setcookie ${COOKIE}" \ + "$ERTS_DIR/bin/escript" \ + "$ROOTDIR/bin/nodetool" \ + "$NAME_TYPE" "$NAME" \ + "$command" $@ else - ERL_FLAGS="${ERL_FLAGS} ${MAYBE_DIST_ARGS}" "$ERTS_DIR/bin/escript" \ - "$ROOTDIR/bin/nodetool" "$NAME_TYPE" "$NAME" \ - $START_EPMD -setcookie "$COOKIE" "$command" $@ + ERL_FLAGS="${ERL_FLAGS} ${MAYBE_DIST_ARGS} ${NAME_TYPE} $nodetool_id -setcookie ${COOKIE}" \ + "$ERTS_DIR/bin/escript" \ + "$ROOTDIR/bin/nodetool" \ + $START_EPMD "$NAME_TYPE" "$NAME" "$command" $@ fi - } # Run an escript in the node's environment -- cgit v1.2.3