From 074edc6eb5746d42ef04dedb83028a85894883f7 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Fri, 9 May 2014 18:51:49 -0500 Subject: append @hostname if missing from sname, for remsh --- priv/templates/extended_bin.dtl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/priv/templates/extended_bin.dtl b/priv/templates/extended_bin.dtl index 807116b..92e89f7 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" @@ -87,6 +87,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 -- cgit v1.2.3