aboutsummaryrefslogtreecommitdiffstats
path: root/priv
diff options
context:
space:
mode:
authorLuis Rascao <[email protected]>2016-12-18 18:15:24 +0000
committerLuis Rascao <[email protected]>2016-12-18 21:14:56 +0000
commit261b5ae9d46ae4dd001cbaa9cf911cd1abe30673 (patch)
treefb9a7ec7d8fbb17e21283a840ae5dfec227923c6 /priv
parentbec4f5c38fe7e094f6d7e3a820fb635b7d65a949 (diff)
downloadrelx-261b5ae9d46ae4dd001cbaa9cf911cd1abe30673.tar.gz
relx-261b5ae9d46ae4dd001cbaa9cf911cd1abe30673.tar.bz2
relx-261b5ae9d46ae4dd001cbaa9cf911cd1abe30673.zip
Obtain release node name from Erlang VM instead of OS
Diffstat (limited to 'priv')
-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