Skip to content

Commit 1646540

Browse files
authored
Merge pull request #849 from tsloughter/remsh-hostname
include hostname when creating a remote shell
2 parents 29158e2 + fd73851 commit 1646540

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

priv/templates/extended_bin

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,10 @@ relx_rem_sh() {
283283
# for long names with 23.1 (erts 11.1) and above.
284284
if [ "${NAME_TYPE}" = "-sname" ] && [ "11.0" = "$(printf "%s\n11.0" "${ERTS_VSN}" | sort -V | head -n1)" ] ; then
285285

286-
remote_nodename="${NAME_TYPE} undefined"
286+
remote_nodename="${NAME_TYPE} undefined@${RELX_HOSTNAME}"
287287
# if the name type is longnames then make sure this is erts 11.1+
288288
elif [ "${NAME_TYPE}" = "-name" ] && [ "11.1" = "$(printf "%s\n11.1" "${ERTS_VSN}" | sort -V | head -n1)" ] ; then
289-
remote_nodename="${NAME_TYPE} undefined"
289+
remote_nodename="${NAME_TYPE} undefined@${RELX_HOSTNAME}"
290290
else
291291
# Generate a unique id used to allow multiple remsh to the same node transparently
292292
remote_nodename="${NAME_TYPE} remsh$(relx_gen_id)-${NAME}"
@@ -700,6 +700,9 @@ esac
700700
# Export the variable so that it's available in the 'eval' calls
701701
export NAME
702702

703+
# create a variable of just the hostname part of the nodename
704+
RELX_HOSTNAME=$(echo "${NAME}" | cut -d'@' -f2)
705+
703706
test -z "$PIPE_DIR" && PIPE_BASE_DIR='/tmp/erl_pipes/'
704707
PIPE_DIR="${PIPE_DIR:-/tmp/erl_pipes/$NAME/}"
705708

0 commit comments

Comments
 (0)