aboutsummaryrefslogtreecommitdiffstats
path: root/priv/templates/extended_bin
diff options
context:
space:
mode:
Diffstat (limited to 'priv/templates/extended_bin')
-rwxr-xr-xpriv/templates/extended_bin18
1 files changed, 9 insertions, 9 deletions
diff --git a/priv/templates/extended_bin b/priv/templates/extended_bin
index c87fcf9..88d2cab 100755
--- a/priv/templates/extended_bin
+++ b/priv/templates/extended_bin
@@ -260,6 +260,14 @@ relx_run_hooks() {
done
}
+find_erts_dir
+export ROOTDIR="$RELEASE_ROOT_DIR"
+export BINDIR="$ERTS_DIR/bin"
+export EMU="beam"
+export PROGNAME="erl"
+export LD_LIBRARY_PATH="$ERTS_DIR/lib:$LD_LIBRARY_PATH"
+ERTS_LIB_DIR="$(dirname "$ERTS_DIR")/lib"
+
VMARGS_PATH=$(add_path vm.args $VMARGS_PATH)
# Extract the target node name from node.args
NAME_ARG=$(egrep '^-s?name' "$VMARGS_PATH" || true)
@@ -280,7 +288,7 @@ NAME="$(echo "$NAME_ARG" | awk '{print $2}')"
# So here we check for @ and add @hostname if missing
case "${NAME}" in
*@*) ;; # Nothing to do
- *) NAME=${NAME}@$(hostname -s);; # Add @hostname
+ *) NAME=${NAME}@$(relx_get_nodename);; # Add @hostname
esac
# Export the variable so that it's available in the 'eval' calls
@@ -309,14 +317,6 @@ else
COOKIE="$(echo "$COOKIE_ARG" | awk '{print $2}')"
fi
-find_erts_dir
-export ROOTDIR="$RELEASE_ROOT_DIR"
-export BINDIR="$ERTS_DIR/bin"
-export EMU="beam"
-export PROGNAME="erl"
-export LD_LIBRARY_PATH="$ERTS_DIR/lib:$LD_LIBRARY_PATH"
-ERTS_LIB_DIR="$(dirname "$ERTS_DIR")/lib"
-
cd "$ROOTDIR"
# Check the first argument for instructions