diff options
author | Luis Rascão <[email protected]> | 2018-02-15 16:56:26 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2018-02-15 16:56:26 +0000 |
commit | 86d415f33c500d432d6c9fa2fcbff3bb2fff3e8f (patch) | |
tree | 2cbd5d32ad9db7f107f0289b283bab425ff3ce25 /priv | |
parent | af3ae8a64f92054ce474f5d67bdd467d3ca8d74e (diff) | |
parent | 310b7047a2dba4d4ed6ef8ef52a96456073e0c16 (diff) | |
download | relx-86d415f33c500d432d6c9fa2fcbff3bb2fff3e8f.tar.gz relx-86d415f33c500d432d6c9fa2fcbff3bb2fff3e8f.tar.bz2 relx-86d415f33c500d432d6c9fa2fcbff3bb2fff3e8f.zip |
Merge pull request #640 from juise/masterv3.24.5
Add extra args from vm.args into escripts and erl
Diffstat (limited to 'priv')
-rwxr-xr-x | priv/templates/extended_bin | 19 |
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 |