Switch to SIGTERM for graceful shutdown in startup.sh

Replaced the `curl` HTTP shutdown call with a `kill -TERM` signal to ensure the JVM shutdown hook executes cleanly. Added a `wait` command to block until the process finishes, enabling a more reliable and proper termination process.
This commit is contained in:
anthorob committed 2026-10-09 12:51:35 -04:00
1 parent e0ec43813d
commit 1f126f29ad
1 file changed
+4 -3
+4 -3
View File
@@ -6,9 +6,10 @@ _term() {
echo "Bot isn't running, exiting." echo "Bot isn't running, exiting."
exit 0 exit 0
else else
/usr/bin/curl --no-progress-meter http://localhost:"$API_PORT"/actions/shutdown # SIGTERM triggers the JVM shutdown hook (App.shutdown); wait until it has finished.
echo "Waiting 2 seconds for bot shutdown" kill -TERM "$pid" 2>/dev/null
sleep 2 wait "$pid"
exit $?
fi fi
} }