From 1335874b4b1a8951180a7093cfb390f9758c8008 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Wei=C3=9F?= Date: Mon, 4 Apr 2022 01:14:06 +0200 Subject: [PATCH] Omit .config file extension from -config argument As per the erl(1) manual, the argument to the -config flag is meant to be "sys" rather than "sys.config" (though both will work). Adjust the start scripts accordingly. --- priv/templates/bin | 2 +- priv/templates/bin_windows | 2 +- priv/templates/extended_bin | 4 ++-- priv/templates/extended_bin_windows | 2 +- priv/templates/psutil | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/priv/templates/bin b/priv/templates/bin index e79d01f5d..5a7eaec5e 100644 --- a/priv/templates/bin +++ b/priv/templates/bin @@ -83,7 +83,7 @@ IFS="$IFS_NORM" # Build arguments for erlexec set -- [ "$ERL_OPTS" ] && set -- "$@" "$ERL_OPTS" -[ "$SYS_CONFIG" ] && set -- "$@" -config "$SYS_CONFIG" +[ "$SYS_CONFIG" ] && set -- "$@" -config "${SYS_CONFIG%.config}" [ "$VM_ARGS" ] && set -- "$@" -args_file "$VM_ARGS" set -- "$@" -boot_var SYSTEM_LIB_DIR "$SYSTEM_LIB_DIR" -boot "$REL_DIR/$BOOTFILE" {{! Split string with extra arguments back into an argument list. }} diff --git a/priv/templates/bin_windows b/priv/templates/bin_windows index 36e2e034f..d2883b42f 100644 --- a/priv/templates/bin_windows +++ b/priv/templates/bin_windows @@ -41,7 +41,7 @@ echo Rootdir=%converted_rootdir% >> "%erl_ini%" :: Start the release in an `erl` shell set boot=-boot "%boot_script%" -boot_var RELEASE_DIR "%release_root_dir%" -"%erl%" %erl_opts% %sys_config% %boot% %* +"%erl%" %erl_opts% %sys_config:.config=% %boot% %* goto :eof diff --git a/priv/templates/extended_bin b/priv/templates/extended_bin index 3fbee28dd..7b3b86cc5 100644 --- a/priv/templates/extended_bin +++ b/priv/templates/extended_bin @@ -979,7 +979,7 @@ case "$1" in echo "Exec: $BINDIR/erlexec" $FOREGROUNDOPTIONS \ -boot "$BOOTFILE" -mode "$CODE_LOADING_MODE" \ -boot_var SYSTEM_LIB_DIR "$SYSTEM_LIB_DIR" \ - -config "$RELX_CONFIG_PATH" \ + -config ${RELX_CONFIG_PATH%.config} \ -args_file "$VMARGS_PATH" \ $EXTRA_DIST_ARGS -- "$@" echo "Root: $ROOTDIR" @@ -1000,7 +1000,7 @@ case "$1" in exec "$BINDIR/erlexec" $FOREGROUNDOPTIONS \ -boot "$BOOTFILE" -mode "$CODE_LOADING_MODE" \ -boot_var SYSTEM_LIB_DIR "$SYSTEM_LIB_DIR" \ - -config "$RELX_CONFIG_PATH" \ + -config ${RELX_CONFIG_PATH%.config} \ -args_file "$VMARGS_PATH" \ $EXTRA_DIST_ARGS -- "$@" # exec will replace the current image and nothing else gets diff --git a/priv/templates/extended_bin_windows b/priv/templates/extended_bin_windows index 668cc2aad..c22c732d6 100644 --- a/priv/templates/extended_bin_windows +++ b/priv/templates/extended_bin_windows @@ -317,7 +317,7 @@ goto :eof :: Start a console :console set boot=-boot "%boot_script%" -boot_var RELEASE_DIR "%release_root_dir%" -start "%rel_name% console" %werl% %boot% %sys_config% ^ +start "%rel_name% console" %werl% %boot% %sys_config:.config=% ^ -args_file "%vm_args%" goto :eof diff --git a/priv/templates/psutil b/priv/templates/psutil index 5c54a6915..fe5384a82 100644 --- a/priv/templates/psutil +++ b/priv/templates/psutil @@ -90,7 +90,7 @@ function Find-FormatConfig() } } - return $out + return $out -replace '\.config$', '' } function Format-OSVars()