aboutsummaryrefslogtreecommitdiffstats
path: root/priv/templates/extended_bin
diff options
context:
space:
mode:
Diffstat (limited to 'priv/templates/extended_bin')
-rwxr-xr-xpriv/templates/extended_bin20
1 files changed, 13 insertions, 7 deletions
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