fix(docker): exit cleanly on container stop

This commit is contained in:
4gray committed 2026-05-21 03:12:57 +03:00
1 parent 6afaa04a95
commit 7bd5957119
1 file changed
+7 -1
+7 -1
View File
@@ -42,6 +42,11 @@ cleanup() {
fi
}
handle_signal() {
cleanup
exit 0
}
process_is_running() {
if [ ! -r "/proc/$1/stat" ]; then
return 1
@@ -51,7 +56,8 @@ process_is_running() {
[ -n "$state" ] && [ "$state" != "Z" ]
}
trap cleanup INT TERM EXIT
trap handle_signal INT TERM
trap cleanup EXIT
backend_ready=0