From 9c3003071bdeb0efa642b5ca4fc29280cdfe44f5 Mon Sep 17 00:00:00 2001 From: Uwe Schaefer Date: Tue, 23 Feb 2016 19:13:12 +0100 Subject: [PATCH 1/2] Add CONF_FOLDER property Closes gh-5203 --- spring-boot-docs/src/main/asciidoc/deployment.adoc | 3 +++ .../org/springframework/boot/loader/tools/launch.script | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/spring-boot-docs/src/main/asciidoc/deployment.adoc b/spring-boot-docs/src/main/asciidoc/deployment.adoc index bdbd61b9fb0..f36630f9882 100644 --- a/spring-boot-docs/src/main/asciidoc/deployment.adoc +++ b/spring-boot-docs/src/main/asciidoc/deployment.adoc @@ -571,6 +571,9 @@ the default behavior in a script or on the command line: |`LOG_FOLDER` |The name of the folder to put log files in (`/var/log` by default). +|`CONF_FOLDER` +|The name of the folder to read .conf files from (same folder as jar-file by default). + |`LOG_FILENAME` |The name of the log file in the `LOG_FOLDER` (`.log` by default). diff --git a/spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script b/spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script index 25fd71bf3a2..eb76e73793c 100755 --- a/spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script +++ b/spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script @@ -42,8 +42,12 @@ cd "$WORKING_DIR" || exit 1 # Source any config file configfile="$(basename "${jarfile%.*}.conf")" + +# Initialize CONF_FOLDER location defaulting to jarfolder +[[ -z "$CONF_FOLDER" ]] && CONF_FOLDER="${jarfolder}" + # shellcheck source=/dev/null -[[ -r "${jarfolder}/${configfile}" ]] && source "${jarfolder}/${configfile}" +[[ -r "${CONF_FOLDER}/${configfile}" ]] && source "${CONF_FOLDER}/${configfile}" # Initialize PID/LOG locations if they weren't provided by the config file [[ -z "$PID_FOLDER" ]] && PID_FOLDER="{{pidFolder:/var/run}}" From d93b09f497820b434e512ea0317296cd4ba7a189 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 29 Feb 2016 11:42:27 +0100 Subject: [PATCH 2/2] Polish contribution Closes gh-5204 --- spring-boot-docs/src/main/asciidoc/deployment.adoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-boot-docs/src/main/asciidoc/deployment.adoc b/spring-boot-docs/src/main/asciidoc/deployment.adoc index f36630f9882..86d2d4e90fe 100644 --- a/spring-boot-docs/src/main/asciidoc/deployment.adoc +++ b/spring-boot-docs/src/main/asciidoc/deployment.adoc @@ -657,9 +657,10 @@ a `.conf` file, LOG_FOLDER=/custom/log/folder ---- -The file should be situated next to the jar file and have the same name but suffixed with +The file is expected next to the jar file and have the same name but suffixed with `.conf` rather than `.jar`. For example, a jar named `/var/myapp/myapp.jar` will use the -configuration file named `/var/myapp/myapp.conf` if it exists. +configuration file named `/var/myapp/myapp.conf` if it exists. You can also use the +`CONF_FOLDER` property to customize the location of that file. To learn about securing this file appropriately, please refer to <>.