Skip to content

Commit 7c6c213

Browse files
committed
enhance shutdown monitoring to allow cleanup before exiting the container
1 parent 4000e3c commit 7c6c213

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

images/arkmanager/entrypoint.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,11 @@ monitor_shutdown() {
453453
# Kill any background monitoring processes
454454
[[ -n "${STATUS_MONITOR_PID}" ]] && kill "${STATUS_MONITOR_PID}" 2>/dev/null
455455
[[ -n "${SHUTDOWN_MONITOR_PID}" ]] && kill "${SHUTDOWN_MONITOR_PID}" 2>/dev/null
456-
# Exit the container
456+
# Give processes a moment to clean up
457+
sleep 1
458+
# Force kill the container by killing PID 1 (init process)
459+
kill -TERM 1 2>/dev/null || kill -KILL 1 2>/dev/null || true
460+
# Exit the container as fallback
457461
exit 0
458462
fi
459463
fi

0 commit comments

Comments
 (0)