aboutsummaryrefslogtreecommitdiffstats
path: root/priv/templates/extended_bin
diff options
context:
space:
mode:
Diffstat (limited to 'priv/templates/extended_bin')
-rwxr-xr-xpriv/templates/extended_bin36
1 files changed, 35 insertions, 1 deletions
diff --git a/priv/templates/extended_bin b/priv/templates/extended_bin
index 78f25e0..a06c2c3 100755
--- a/priv/templates/extended_bin
+++ b/priv/templates/extended_bin
@@ -312,6 +312,16 @@ relx_run_hooks() {
done
}
+relx_disable_hooks() {
+ PRE_START_HOOKS=""
+ POST_START_HOOKS=""
+ PRE_STOP_HOOKS=""
+ POST_STOP_HOOKS=""
+ PRE_INSTALL_UPGRADE_HOOKS=""
+ POST_INSTALL_UPGRADE_HOOKS=""
+ STATUS_HOOK=""
+}
+
relx_is_extension() {
EXTENSION=$1
case "$EXTENSION" in
@@ -346,6 +356,26 @@ relx_run_extension() {
[ "$SCRIPT_DIR/$EXTENSION_SCRIPT" ] && . "$SCRIPT_DIR/$EXTENSION_SCRIPT" $@
}
+# given a list of arguments, identify the internal ones
+# --relx-disable-hooks
+# and process them accordingly
+process_internal_args() {
+ for arg in $@
+ do
+ shift
+ case "$arg" in
+ --relx-disable-hooks)
+ relx_disable_hooks
+ ;;
+ *)
+ ;;
+ esac
+ done
+}
+
+# process internal arguments
+process_internal_args $@
+
find_erts_dir
export ROOTDIR="$RELEASE_ROOT_DIR"
export BINDIR="$ERTS_DIR/bin"
@@ -500,7 +530,7 @@ case "$1" in
relx_run_hooks "$PRE_START_HOOKS"
"$BINDIR/run_erl" -daemon "$PIPE_DIR" "$RUNNER_LOG_DIR" \
- "exec \"$RELEASE_ROOT_DIR/bin/$REL_NAME\" \"$START_OPTION\" $ARGS"
+ "exec \"$RELEASE_ROOT_DIR/bin/$REL_NAME\" \"$START_OPTION\" --relx-disable-hooks $ARGS"
relx_run_hooks "$POST_START_HOOKS"
;;
@@ -675,6 +705,7 @@ case "$1" in
echo "$RELEASE_ROOT_DIR"
logger -t "$REL_NAME[$$]" "Starting up"
+ relx_run_hooks "$PRE_START_HOOKS"
# Start the VM
exec "$BINDIR/erlexec" $FOREGROUNDOPTIONS \
-boot "$BOOTFILE" -mode "$CODE_LOADING_MODE" \
@@ -682,6 +713,9 @@ case "$1" in
-config "$RELX_CONFIG_PATH" \
-args_file "$VMARGS_PATH" \
-pa ${__code_paths} -- "$@"
+ # exec will replace the current image and nothing else gets
+ # executed from this point on, this explains the absence
+ # of the pre start hook
;;
rpc)
# Make sure a node IS running