From 98be051cfadfccb26555aaa78fca88b88d6c082e Mon Sep 17 00:00:00 2001 From: Pedro Vilaca Date: Mon, 2 Nov 2015 19:14:10 +0000 Subject: [PATCH] Don't remove PID file before stopping the service Update the launch script so that the PID file is not longer removed at the beginning of the stop method. Prior to this commit if a service wasn't able to stop on the first run, it wasn't possible to use the launch script anymore. Fixes gh-4369 Closes gh-4371 --- .../org/springframework/boot/loader/tools/launch.script | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 ad70066ca41..d0edff54afa 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 @@ -160,8 +160,7 @@ do_start() { stop() { [[ -f $pid_file ]] || { echoYellow "Not running (pidfile not found)"; return 0; } pid=$(cat "$pid_file") - rm -f "$pid_file" - isRunning $pid || { echoYellow "Not running (process ${pid} not found)"; return 0; } + isRunning $pid || { echoYellow "Not running (process ${pid}). Removing stale pid file."; rm -f "$pid_file"; return 0; } do_stop $pid $pid_file }