aboutsummaryrefslogtreecommitdiffstats
path: root/priv
diff options
context:
space:
mode:
authorAlexander Petrovsky <[email protected]>2018-02-11 22:56:39 +0300
committerAlexander Petrovsky <[email protected]>2018-02-15 18:30:25 +0300
commit310b7047a2dba4d4ed6ef8ef52a96456073e0c16 (patch)
tree2cbd5d32ad9db7f107f0289b283bab425ff3ce25 /priv
parentaf3ae8a64f92054ce474f5d67bdd467d3ca8d74e (diff)
downloadrelx-310b7047a2dba4d4ed6ef8ef52a96456073e0c16.tar.gz
relx-310b7047a2dba4d4ed6ef8ef52a96456073e0c16.tar.bz2
relx-310b7047a2dba4d4ed6ef8ef52a96456073e0c16.zip
Add extra args from vm.args into escripts and erl
Diffstat (limited to 'priv')
-rwxr-xr-xpriv/templates/extended_bin19
1 files changed, 18 insertions, 1 deletions
diff --git a/priv/templates/extended_bin b/priv/templates/extended_bin
index ac74358..1e8aa63 100755
--- a/priv/templates/extended_bin
+++ b/priv/templates/extended_bin
@@ -167,7 +167,7 @@ relx_rem_sh() {
# Setup remote shell command to control node
exec "$BINDIR/erl" "$NAME_TYPE" "$id" -remsh "$NAME" -boot start_clean \
-boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
- -setcookie "$COOKIE" -hidden -kernel net_ticktime $TICKTIME
+ -setcookie "$COOKIE" -hidden -kernel net_ticktime $TICKTIME $VM_ARGS
}
# Generate a random id
@@ -179,6 +179,8 @@ relx_gen_id() {
relx_nodetool() {
command="$1"; shift
+ escript_emulator_args $ROOTDIR/bin/nodetool
+
"$ERTS_DIR/bin/escript" "$ROOTDIR/bin/nodetool" "$NAME_TYPE" "$NAME" \
-setcookie "$COOKIE" "$command" $@
}
@@ -228,6 +230,19 @@ replace_os_vars() {
}1' < "$1" > "$2"
}
+escript_emulator_args() {
+ if [ -n "${VM_ARGS}" ]; then
+ if grep -q '%%!' $1; then
+ cmd=$(echo sed -i"' '" "'s|%%!.*|%%! ${VM_ARGS}|'" $1)
+ eval "$cmd"
+ else
+ cmd=$(echo sed -i"' '" "'/#!.*/ a \\
+%%! ${VM_ARGS}\n'" $1)
+ eval "$cmd"
+ fi
+ fi
+}
+
add_path() {
# Use $CWD/$1 if exists, otherwise releases/VSN/$1
IN_FILE_PATH=$2
@@ -442,6 +457,8 @@ else
COOKIE="$(echo "$COOKIE_ARG" | awk '{print $2}')"
fi
+VM_ARGS="$(grep -v -E '^#|^-name|^-sname|^-setcookie|^-args_file' "$VMARGS_PATH" | xargs | sed -e 's/ / /g')"
+
cd "$ROOTDIR"
# Check the first argument for instructions