mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 11:06:20 +00:00
Merge pull request #135 from mokele/runner-vm-args-fix
fix vm.args checks by always using $VMARGS_PATH
This commit is contained in:
commit
4ddfb3d235
1 changed files with 24 additions and 25 deletions
|
@ -21,21 +21,6 @@ cd $RUNNER_BASE_DIR
|
||||||
|
|
||||||
# Make sure log directory exists
|
# Make sure log directory exists
|
||||||
mkdir -p $RUNNER_LOG_DIR
|
mkdir -p $RUNNER_LOG_DIR
|
||||||
|
|
||||||
# Extract the target node name from node.args
|
|
||||||
NAME_ARG=`egrep '^-s?name' $RUNNER_ETC_DIR/vm.args`
|
|
||||||
if [ -z "$NAME_ARG" ]; then
|
|
||||||
echo "vm.args needs to have either -name or -sname parameter."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Extract the target cookie
|
|
||||||
COOKIE_ARG=`grep '^-setcookie' $RUNNER_ETC_DIR/vm.args`
|
|
||||||
if [ -z "$COOKIE_ARG" ]; then
|
|
||||||
echo "vm.args needs to have a -setcookie parameter."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Identify the script name
|
# Identify the script name
|
||||||
SCRIPT=`basename $0`
|
SCRIPT=`basename $0`
|
||||||
|
|
||||||
|
@ -44,11 +29,12 @@ START_ERL=`cat $RUNNER_BASE_DIR/releases/start_erl.data`
|
||||||
ERTS_VSN=${START_ERL% *}
|
ERTS_VSN=${START_ERL% *}
|
||||||
APP_VSN=${START_ERL#* }
|
APP_VSN=${START_ERL#* }
|
||||||
|
|
||||||
# Add ERTS bin dir to our path
|
# Use releases/VSN/vm.args if it exists otherwise use etc/vm.args
|
||||||
ERTS_PATH=$RUNNER_BASE_DIR/erts-$ERTS_VSN/bin
|
if [ -e "$RUNNER_BASE_DIR/releases/$APP_VSN/vm.args" ]; then
|
||||||
|
VMARGS_PATH="$RUNNER_BASE_DIR/releases/$APP_VSN/vm.args"
|
||||||
# Setup command to control the node
|
else
|
||||||
NODETOOL="$ERTS_PATH/escript $ERTS_PATH/nodetool $NAME_ARG $COOKIE_ARG"
|
VMARGS_PATH="$RUNNER_ETC_DIR/vm.args"
|
||||||
|
fi
|
||||||
|
|
||||||
# Use releases/VSN/sys.config if it exists otherwise use etc/app.config
|
# Use releases/VSN/sys.config if it exists otherwise use etc/app.config
|
||||||
if [ -e "$RUNNER_BASE_DIR/releases/$APP_VSN/sys.config" ]; then
|
if [ -e "$RUNNER_BASE_DIR/releases/$APP_VSN/sys.config" ]; then
|
||||||
|
@ -57,13 +43,26 @@ else
|
||||||
CONFIG_PATH="$RUNNER_ETC_DIR/app.config"
|
CONFIG_PATH="$RUNNER_ETC_DIR/app.config"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use releases/VSN/vm.args if it exists otherwise use etc/vm.args
|
# Extract the target node name from node.args
|
||||||
if [-e "$RUNNER_BASE_DIR/releases/$APP_VSN/vm.args" ]; then
|
NAME_ARG=`egrep '^-s?name' $VMARGS_PATH`
|
||||||
VMARGS_PATH="$RUNNER_BASE_DIR/releases/$APP_VSN/vm.args"
|
if [ -z "$NAME_ARG" ]; then
|
||||||
else
|
echo "vm.args needs to have either -name or -sname parameter."
|
||||||
VMARGS_PATH="$RUNNER_ETC_DIR/vm.args"
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Extract the target cookie
|
||||||
|
COOKIE_ARG=`grep '^-setcookie' $VMARGS_PATH`
|
||||||
|
if [ -z "$COOKIE_ARG" ]; then
|
||||||
|
echo "vm.args needs to have a -setcookie parameter."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add ERTS bin dir to our path
|
||||||
|
ERTS_PATH=$RUNNER_BASE_DIR/erts-$ERTS_VSN/bin
|
||||||
|
|
||||||
|
# Setup command to control the node
|
||||||
|
NODETOOL="$ERTS_PATH/escript $ERTS_PATH/nodetool $NAME_ARG $COOKIE_ARG"
|
||||||
|
|
||||||
# Check the first argument for instructions
|
# Check the first argument for instructions
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
|
|
Loading…
Reference in a new issue