Skip to content

Commit

Permalink
relx script patch to control node name and cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
k-anderson committed Jun 8, 2016
1 parent a81436e commit 7cccdd6
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions rel/relx.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@@ -149,7 +149,7 @@
fi

# Extract the target node name from node.args
-NAME_ARG=$(egrep '^-s?name' "$VMARGS_PATH" || true)
+NAME_ARG=${NAME_ARG:-$(egrep '^-s?name' "$VMARGS_PATH" || true)}
if [ -z "$NAME_ARG" ]; then
echo "vm.args needs to have either -name or -sname parameter."
exit 1
@@ -162,7 +162,7 @@
PIPE_DIR="${PIPE_DIR:-/tmp/erl_pipes/$NAME/}"

# Extract the target cookie
-COOKIE_ARG="$(grep '^-setcookie' "$VMARGS_PATH" || true)"
+COOKIE_ARG="${COOKIE_ARG:-$(grep '^-setcookie' "$VMARGS_PATH" || true)}"
if [ -z "$COOKIE_ARG" ]; then
echo "vm.args needs to have a -setcookie parameter."
exit 1
@@ -374,6 +374,7 @@
set -- "$BINDIR/erlexec" -boot "$BOOTFILE" -mode "$CODE_LOADING_MODE" \
-boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
-config "$RELX_CONFIG_PATH" \
+ $NAME_ARG \
-args_file "$VMARGS_PATH"

# Dump environment info for logging purposes
@@ -410,6 +411,7 @@
set -- "$BINDIR/erlexec" $FOREGROUNDOPTIONS \
-boot "$REL_DIR/$BOOTFILE" -mode "$CODE_LOADING_MODE" -config "$RELX_CONFIG_PATH" \
-boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
+ $NAME_ARG \
-args_file "$VMARGS_PATH"

# Dump environment info for logging purposes

0 comments on commit 7cccdd6

Please sign in to comment.