Commit 98be051c authored by Pedro Vilaca's avatar Pedro Vilaca Committed by Phillip Webb

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
parent 0bac6ebd
...@@ -160,8 +160,7 @@ do_start() { ...@@ -160,8 +160,7 @@ do_start() {
stop() { stop() {
[[ -f $pid_file ]] || { echoYellow "Not running (pidfile not found)"; return 0; } [[ -f $pid_file ]] || { echoYellow "Not running (pidfile not found)"; return 0; }
pid=$(cat "$pid_file") pid=$(cat "$pid_file")
rm -f "$pid_file" isRunning $pid || { echoYellow "Not running (process ${pid}). Removing stale pid file."; rm -f "$pid_file"; return 0; }
isRunning $pid || { echoYellow "Not running (process ${pid} not found)"; return 0; }
do_stop $pid $pid_file do_stop $pid $pid_file
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment