summaryrefslogtreecommitdiff
path: root/priv/templates
diff options
context:
space:
mode:
authorSteven Gravell <steve.gravell@smarkets.com>2011-09-21 16:09:56 +0100
committerSteven Gravell <steve.gravell@smarkets.com>2011-09-21 16:09:56 +0100
commitfbd26143bbee05af9b222c1010d9718746fb7997 (patch)
treec780ebb6682f6f28a6792fdf8a7b2a1e25a37f2a /priv/templates
parent9bf31b7389d44e4ed0816099293fe1171914eb95 (diff)
fix vm.args checks by always using $VMARGS_PATH
Diffstat (limited to 'priv/templates')
-rwxr-xr-xpriv/templates/simplenode.runner47
1 files changed, 23 insertions, 24 deletions
diff --git a/priv/templates/simplenode.runner b/priv/templates/simplenode.runner
index 78d6bae..03b27aa 100755
--- a/priv/templates/simplenode.runner
+++ b/priv/templates/simplenode.runner
@@ -21,49 +21,48 @@ cd $RUNNER_BASE_DIR
# Make sure log directory exists
mkdir -p $RUNNER_LOG_DIR
+# Identify the script name
+SCRIPT=`basename $0`
+
+# Parse out release and erts info
+START_ERL=`cat $RUNNER_BASE_DIR/releases/start_erl.data`
+ERTS_VSN=${START_ERL% *}
+APP_VSN=${START_ERL#* }
+
+# Use releases/VSN/vm.args if it exists otherwise use etc/vm.args
+if [ -e "$RUNNER_BASE_DIR/releases/$APP_VSN/vm.args" ]; then
+ VMARGS_PATH="$RUNNER_BASE_DIR/releases/$APP_VSN/vm.args"
+else
+ VMARGS_PATH="$RUNNER_ETC_DIR/vm.args"
+fi
+
+# Use releases/VSN/sys.config if it exists otherwise use etc/app.config
+if [ -e "$RUNNER_BASE_DIR/releases/$APP_VSN/sys.config" ]; then
+ CONFIG_PATH="$RUNNER_BASE_DIR/releases/$APP_VSN/sys.config"
+else
+ CONFIG_PATH="$RUNNER_ETC_DIR/app.config"
+fi
# Extract the target node name from node.args
-NAME_ARG=`egrep '^-s?name' $RUNNER_ETC_DIR/vm.args`
+NAME_ARG=`egrep '^-s?name' $VMARGS_PATH`
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`
+COOKIE_ARG=`grep '^-setcookie' $VMARGS_PATH`
if [ -z "$COOKIE_ARG" ]; then
echo "vm.args needs to have a -setcookie parameter."
exit 1
fi
-# Identify the script name
-SCRIPT=`basename $0`
-
-# Parse out release and erts info
-START_ERL=`cat $RUNNER_BASE_DIR/releases/start_erl.data`
-ERTS_VSN=${START_ERL% *}
-APP_VSN=${START_ERL#* }
-
# 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"
-# Use releases/VSN/sys.config if it exists otherwise use etc/app.config
-if [ -e "$RUNNER_BASE_DIR/releases/$APP_VSN/sys.config" ]; then
- CONFIG_PATH="$RUNNER_BASE_DIR/releases/$APP_VSN/sys.config"
-else
- CONFIG_PATH="$RUNNER_ETC_DIR/app.config"
-fi
-
-# Use releases/VSN/vm.args if it exists otherwise use etc/vm.args
-if [-e "$RUNNER_BASE_DIR/releases/$APP_VSN/vm.args" ]; then
- VMARGS_PATH="$RUNNER_BASE_DIR/releases/$APP_VSN/vm.args"
-else
- VMARGS_PATH="$RUNNER_ETC_DIR/vm.args"
-fi
-
# Check the first argument for instructions
case "$1" in
start)