The current launch script uses seq
in a subshell in the stop
action to wait for the process to terminate. seq
is not present on all Unix/Linux like systems, for example on AIX. This will cause an error and a return code not equal to 0. A native loop can be used to increase compatibility and it avoids the subshell.
diff --git spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script
index a7bbd78b09..ffded42d7c 100755
--- spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script
+++ spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script
@@ -223,7 +223,7 @@ stop() {
do_stop() {
kill "$1" &> /dev/null || { echoRed "Unable to kill process $1"; return 1; }
- for i in $(seq 1 $STOP_WAIT_TIME); do
+ for ((i = 1; i <= $STOP_WAIT_TIME; i++)); do
isRunning "$1" || { echoGreen "Stopped [$1]"; rm -f "$2"; return 0; }
[[ $i -eq STOP_WAIT_TIME/2 ]] && kill "$1" &> /dev/null
sleep 1
@@ -241,7 +241,7 @@ force_stop() {
do_force_stop() {
kill -9 "$1" &> /dev/null || { echoRed "Unable to kill process $1"; return 1; }
- for i in $(seq 1 $STOP_WAIT_TIME); do
+ for ((i = 1; i <= $STOP_WAIT_TIME; i++)); do
isRunning "$1" || { echoGreen "Stopped [$1]"; rm -f "$2"; return 0; }
[[ $i -eq STOP_WAIT_TIME/2 ]] && kill -9 "$1" &> /dev/null
sleep 1