fix image entrypoint sigterm

This commit is contained in:
avigailo
2025-11-05 12:48:16 +02:00
parent b7923dfd8c
commit ad37257d7c

View File

@@ -15,6 +15,18 @@ var_mode=
var_token=
var_ignore=
init=
active_watchdog_pid=
cleanup() {
# Stop watchdog process if running
if [ -n "${active_watchdog_pid}" ] && ps -p ${active_watchdog_pid} > /dev/null 2>&1; then
kill -TERM ${active_watchdog_pid} 2>/dev/null || true
wait ${active_watchdog_pid} 2>/dev/null || true
fi
exit 0
}
trap cleanup SIGTERM SIGINT
if [ ! -f /nano-service-installers/$ORCHESTRATION_INSTALLATION_SCRIPT ]; then
echo "Error: agent installation package doesn't exist."