mirror of
https://github.com/home-assistant/supervisor.git
synced 2026-02-14 23:19:37 +00:00
During system shutdown (reboot/poweroff), the watchdog was incorrectly detecting the Home Assistant Core container as failed and attempting to restart it. This occurred because Docker was stopping all containers in parallel with Supervisor's own shutdown sequence, causing the watchdog to trigger while add-ons were still being stopped. This led to an abrupt termination of Core before it could cleanly shut down its SQLite database, resulting in a warning on the next startup: "The system could not validate that the sqlite3 database was shutdown cleanly". The fix registers a supervisor state change listener that unregisters the watchdog when entering any shutdown state (SHUTDOWN, STOPPING, or CLOSE). This prevents restart attempts during both user-initiated reboots (via API) and external shutdown signals (Docker SIGTERM, console reboot commands). Since SHUTDOWN, STOPPING, and CLOSE are terminal states with no reverse transition back to RUNNING, no re-registration logic is needed. Fixes #6511 Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>