From 04fe55a2ab6196e046f269c195d8693181ab1056 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 11 Jan 2016 17:53:51 +0000 Subject: [PATCH] Improve portability by using type instead of which in the launch script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, the launch script used which to determine the availability of start-stop-daemon. which isn’t available by default on all OSs. For example, it’s not available by default on CentOS 5. This commit updates the launch script to use type when determining if start-stop-daemon is available. This improves the portability of the script and makes the use of type consistent throughout the script. Closes gh-4925 --- .../org/springframework/boot/loader/tools/launch.script | 2 +- 1 file changed, 1 insertion(+), 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 d6778a46a34..b3af16348b7 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 @@ -146,7 +146,7 @@ do_start() { chown "$run_user" "$PID_FOLDER" chown "$run_user" "$pid_file" chown "$run_user" "$log_file" - if [ "${useStartStopDaemon:-true}" = true ] && which start-stop-daemon >/dev/null; then + if [ "${useStartStopDaemon:-true}" = true ] && type start-stop-daemon > /dev/null 2>&1; then start-stop-daemon --start --quiet \ --chuid "$run_user" \ --name "$identity" \