From 5a1ee6ebe8569884fa78383ae5cf298cb978067d Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 15 Dec 2015 20:35:47 +0000 Subject: [PATCH] Allow easy opt-out of using start-stop-daemon Allow users to easily opt-opt of using the start-stop-daemon in the launch script. This may be required on distros that include older versions. Fixes gh-4732 --- spring-boot-docs/src/main/asciidoc/deployment.adoc | 9 +++++++-- .../org/springframework/boot/loader/tools/launch.script | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/spring-boot-docs/src/main/asciidoc/deployment.adoc b/spring-boot-docs/src/main/asciidoc/deployment.adoc index a0a29be76b..b5474b7ccd 100644 --- a/spring-boot-docs/src/main/asciidoc/deployment.adoc +++ b/spring-boot-docs/src/main/asciidoc/deployment.adoc @@ -536,7 +536,7 @@ the `embeddedLaunchScriptProperties` option of the Spring Boot Maven or Gradle p |`initInfoProvides` |The `Provides` section of "`INIT INFO`". Defaults to `spring-boot-application` for Gradle -and to `${project.artifactId}` for Maven. + and to `${project.artifactId}` for Maven. |`initInfoShortDescription` |The `Short-Description` section of "`INIT INFO`". Defaults to `Spring Boot Application` @@ -544,13 +544,18 @@ for Gradle and to `${project.name}` for Maven. |`initInfoDescription` |The `Description` section of "`INIT INFO`". Defaults to `Spring Boot Application` for -Gradle and to `${project.description}` (falling back to `${project.name}`) for Maven. + Gradle and to `${project.description}` (falling back to `${project.name}`) for Maven. |`initInfoChkconfig` |The `chkconfig` section of "`INIT INFO`". Defaults to `2345 99 01`. + +|`useStartStopDaemon` +|If the start-stop command should be used to control the process when it's available. + Defaults to `true`. |=== + [[deployment-script-customization-conf-file]] ==== Customizing the startup script with a conf file 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 26639c1e48..2804e09e10 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 @@ -143,7 +143,7 @@ do_start() { chown "$run_user" "$PID_FOLDER" chown "$run_user" "$pid_file" chown "$run_user" "$log_file" - if which start-stop-daemon >/dev/null; then + if [ {{useStartStopDaemon:true}} = true ] && which start-stop-daemon >/dev/null; then start-stop-daemon --start --quiet \ --chuid $run_user \ --name $identity \