aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--priv/templates/extended_bin.dtl15
1 files changed, 14 insertions, 1 deletions
diff --git a/priv/templates/extended_bin.dtl b/priv/templates/extended_bin.dtl
index 0dcdd18..0b6c763 100644
--- a/priv/templates/extended_bin.dtl
+++ b/priv/templates/extended_bin.dtl
@@ -30,7 +30,7 @@ relx_rem_sh() {
# Generate a unique id used to allow multiple remsh to the same node
# transparently
id="remsh$(relx_gen_id)-${NAME}"
-
+
# Setup remote shell command to control node
exec "$BINDIR/erl" "$NAME_TYPE" "$id" -remsh "$NAME" -boot start_clean \
-setcookie "$COOKIE"
@@ -97,6 +97,19 @@ fi
NAME_TYPE="$(echo "$NAME_ARG" | awk '{print $1}')"
NAME="$(echo "$NAME_ARG" | awk '{print $2}')"
+# User can specify an sname without @hostname
+# This will fail when creating remote shell
+# So here we check for @ and add @hostname if missing
+case $NAME in
+ *@*)
+ # Nothing to do
+ ;;
+ *)
+ # Add @hostname
+ NAME=$NAME@`hostname`
+ ;;
+esac
+
# Extract the target cookie
COOKIE_ARG="$(grep '^-setcookie' "$VMARGS_PATH")"
if [ -z "$COOKIE_ARG" ]; then