aboutsummaryrefslogtreecommitdiffstats
path: root/priv/templates/extended_bin
diff options
context:
space:
mode:
authorPanagiotis PJ Papadomitsos <[email protected]>2015-09-15 11:19:19 -0700
committerPanagiotis PJ Papadomitsos <[email protected]>2015-09-15 11:19:19 -0700
commitf63d3ad3f42f4b6fc1cab196e19ddc98ba58e9b6 (patch)
tree2db2c09c389b4c0a7af9d6c12b60300c883fc64a /priv/templates/extended_bin
parent979766f0f57730af8cea94aa23947026af77f286 (diff)
downloadrelx-f63d3ad3f42f4b6fc1cab196e19ddc98ba58e9b6.tar.gz
relx-f63d3ad3f42f4b6fc1cab196e19ddc98ba58e9b6.tar.bz2
relx-f63d3ad3f42f4b6fc1cab196e19ddc98ba58e9b6.zip
Startup script improvements
- Made the standard and extended startup scripts self-link-aware. This helps with deployments that symlink the startup script to more standard directories (i.e. /usr/local/bin). readlink is used, which comes standard in all Unix-like distributions - Made the inclusion of a custom sys.config not depend on a custom vm.args file. This way you can use a custom sys.config without using a custom vm.args file
Diffstat (limited to 'priv/templates/extended_bin')
-rwxr-xr-xpriv/templates/extended_bin15
1 files changed, 9 insertions, 6 deletions
diff --git a/priv/templates/extended_bin b/priv/templates/extended_bin
index 5cd8035..1d4da54 100755
--- a/priv/templates/extended_bin
+++ b/priv/templates/extended_bin
@@ -2,8 +2,12 @@
set -e
-SCRIPT_DIR="$(dirname "$0")"
-RELEASE_ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
+SCRIPT=$(readlink $0)
+if [ -z $SCRIPT ]; then
+ SCRIPT=$0
+fi;
+SCRIPT_DIR="$(cd `dirname "$SCRIPT"` && pwd -P)"
+RELEASE_ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd -P)"
REL_NAME="{{ rel_name }}"
REL_VSN="{{ rel_vsn }}"
ERTS_VSN="{{ erts_vsn }}"
@@ -89,9 +93,7 @@ relx_start_command() {
if [ -z "$VMARGS_PATH" ]; then
if [ -f "$RELEASE_ROOT_DIR/vm.args" ]; then
VMARGS_PATH="$RELEASE_ROOT_DIR/vm.args"
- USE_DIR="$RELEASE_ROOT_DIR"
else
- USE_DIR="$REL_DIR"
VMARGS_PATH="$REL_DIR/vm.args"
fi
fi
@@ -104,9 +106,10 @@ fi
# Make sure log directory exists
mkdir -p "$RUNNER_LOG_DIR"
+# Use $CWD/sys.config if exists, otherwise releases/VSN/sys.config
if [ -z "$RELX_CONFIG_PATH" ]; then
- if [ -f "$USE_DIR/sys.config" ]; then
- RELX_CONFIG_PATH="$USE_DIR/sys.config"
+ if [ -f "$RELEASE_ROOT_DIR/sys.config" ]; then
+ RELX_CONFIG_PATH="$RELEASE_ROOT_DIR/sys.config"
else
RELX_CONFIG_PATH="$REL_DIR/sys.config"
fi