diff options
author | Tristan Sloughter <[email protected]> | 2014-05-09 18:51:49 -0500 |
---|---|---|
committer | Tristan Sloughter <[email protected]> | 2014-05-09 20:11:46 -0500 |
commit | 074edc6eb5746d42ef04dedb83028a85894883f7 (patch) | |
tree | 8c0cdbf1e0651d0c02255be819ac5e6ce587fa6e | |
parent | 4c50cb6ab933cd08f51763f9a62436271d9962f5 (diff) | |
download | relx-074edc6eb5746d42ef04dedb83028a85894883f7.tar.gz relx-074edc6eb5746d42ef04dedb83028a85894883f7.tar.bz2 relx-074edc6eb5746d42ef04dedb83028a85894883f7.zip |
append @hostname if missing from sname, for remsh
-rw-r--r-- | priv/templates/extended_bin.dtl | 15 |
1 files changed, 14 insertions, 1 deletions
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 |