You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're now using the launch script that is being created by spring boot to manage the start/stop of our services (integrated with AWS Code Deploy). But sometimes, we're getting some deployment failures because the application didn't stop and the tomcat port is still in use.
Looking at the script, I think that the rm -f "$pid_file" in the stop method isn't correct because the PID file is being deleted before stopping the application.
Although, the do_stop method looks fine because it's triggering the shutdown and waiting until the application is stopped to delete the PID file, so the fix for this issue will just delete the additional line in the stop method.
Or am I missing something?
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; }
do_stop $pid $pid_file
}
do_stop() {
kill -HUP $1 &> /dev/null || { echoRed "Unable to kill process $1"; return 1; }
for i in $(seq 1 60); do
isRunning $1 || { echoGreen "Stopped [$1]"; rm -f $2; return 0; }
sleep 1
done
echoRed "Unable to kill process $1";
return 1;
}
The text was updated successfully, but these errors were encountered:
pmvilaca
pushed a commit
to pmvilaca/spring-boot
that referenced
this issue
Nov 2, 2015
The pid file was being removed at the beginning of the stop method and when the service
wasn't able to stop during the first run, it wasn't possible to use the launch script anymore
Fixesspring-projectsgh-4369
We're now using the launch script that is being created by spring boot to manage the start/stop of our services (integrated with AWS Code Deploy). But sometimes, we're getting some deployment failures because the application didn't stop and the tomcat port is still in use.
Looking at the script, I think that the
rm -f "$pid_file"
in thestop
method isn't correct because the PID file is being deleted before stopping the application.Although, the
do_stop
method looks fine because it's triggering the shutdown and waiting until the application is stopped to delete the PID file, so the fix for this issue will just delete the additional line in thestop
method.Or am I missing something?
The text was updated successfully, but these errors were encountered: