aboutsummaryrefslogtreecommitdiffstats
path: root/priv
diff options
context:
space:
mode:
Diffstat (limited to 'priv')
-rwxr-xr-xpriv/templates/bin8
-rwxr-xr-xpriv/templates/extended_bin15
2 files changed, 15 insertions, 8 deletions
diff --git a/priv/templates/bin b/priv/templates/bin
index 8e3f497..3067259 100755
--- a/priv/templates/bin
+++ b/priv/templates/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 }}"
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