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
pull/4371/merge
Pedro Vilaca 9 years ago committed by Phillip Webb
parent 0bac6ebda7
commit 98be051cfa

@ -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
}

Loading…
Cancel
Save