From 53612c240024b7cf8b0e859488080982544750bf Mon Sep 17 00:00:00 2001 From: Johannes Stelzer Date: Mon, 15 Jun 2015 21:38:19 +0200 Subject: [PATCH 1/2] Allow JVM-options and default arguments to be configured via .conf next to the jar-file --- .../org/springframework/boot/loader/tools/launch.script | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 3a492fb76559..1d3837af1d7b 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 @@ -87,8 +87,13 @@ else exit 1 fi +# source config file to set RUN_ARGS and/or JAVA_OPTS +if [[ -r "/$(dirname "$jarfile")/${identity}.conf" ]]; then + source "/$(dirname "$jarfile")/${identity}.conf" +fi + # Build actual command to execute -command="$javaexe -jar -Dsun.misc.URLClassPath.disableJarChecking=true $jarfile $@" +command="$javaexe -jar -Dsun.misc.URLClassPath.disableJarChecking=true $JAVA_OPTS $jarfile $RUN_ARGS $@" # Action functions start() { From 4f18e01cb9118803d67578cba366c073ea15dcb7 Mon Sep 17 00:00:00 2001 From: Johannes Stelzer Date: Mon, 15 Jun 2015 21:40:41 +0200 Subject: [PATCH 2/2] Add LSB-Header to init-script --- .../springframework/boot/loader/tools/launch.script | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 1d3837af1d7b..6f2209ee270c 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 @@ -9,6 +9,16 @@ # :: Spring Boot Startup Script :: # +### BEGIN INIT INFO +# Provides: spring-boot-application +# Required-Start: $remote_fs $syslog $network +# Required-Stop: $remote_fs $syslog $network +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Spring Boot Application +# Description: Spring Boot Application +### END INIT INFO + [[ -n "$DEBUG" ]] && set -x WORKING_DIR="$(pwd)"