From da84ec162521d7aa5758d21905cd372ea1cf304c Mon Sep 17 00:00:00 2001 From: patrick Date: Sat, 31 Oct 2026 20:19:09 -0400 Subject: [PATCH] Document the unattended-upgrades check Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- docs/how-it-works.md | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ea97f4d..dd71d62 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Each host gets one status. When several apply, the worst one wins: |----------|---------| | `stale` | No report in `stale_after_hours` (default 3h), or never. Other data can't be trusted. | | `reboot` | A newer kernel is installed but not running, or `/run/reboot-required` exists. | -| `update` | A kernel or security update is available but not installed, services are running outdated libraries and need a restart, or apt's package lists are too old, or apt itself fails, so "no updates" can't be trusted. Also when `/boot` is too full for the next kernel, dpkg left packages half-installed, or the OS release no longer gets security updates. | +| `update` | A kernel or security update is available but not installed, services are running outdated libraries and need a restart, or apt's package lists are too old, or apt itself fails, so "no updates" can't be trusted. Also when `/boot` is too full for the next kernel, dpkg left packages half-installed, the OS release no longer gets security updates, or unattended-upgrades is enabled but has stopped succeeding. | | `ok` | Running the newest installed kernel, with no security or kernel updates pending. | Each row lists the reasons behind its status, and clicking a host shows its full diff --git a/docs/how-it-works.md b/docs/how-it-works.md index 853c849..1222850 100644 --- a/docs/how-it-works.md +++ b/docs/how-it-works.md @@ -10,7 +10,7 @@ Each host gets one status. When several apply, the worst one wins: |----------|---------| | `stale` | No report in `stale_after_hours` (default 3h), or never. Other data can't be trusted. | | `reboot` | A newer kernel is installed but not running, or `/run/reboot-required` exists. | -| `update` | A kernel or security update is available but not installed, services are running outdated libraries and need a restart, or apt's package lists are too old (`apt_stale_after_hours`) for "no updates" to mean anything. Also when `/boot` has less than `boot_min_free_mb` free, dpkg left packages half-installed, or the OS release no longer gets security updates. | +| `update` | A kernel or security update is available but not installed, services are running outdated libraries and need a restart, or apt's package lists are too old (`apt_stale_after_hours`) for "no updates" to mean anything. Also when `/boot` has less than `boot_min_free_mb` free, dpkg left packages half-installed, the OS release no longer gets security updates, or unattended-upgrades is enabled but hasn't succeeded in `unattended_upgrades_stale_after_days`. | | `ok` | Running the newest installed kernel, with no security or kernel updates pending. | Each row also lists the reasons behind its status, and clicking a host shows @@ -108,6 +108,24 @@ How the agent works it out: the server, so they need a kernelwatch update when a new release ships; a release the table doesn't know is noted. Agents before 0.7.0 don't report ESM, so an Ubuntu host on one counts as having none. +- **unattended-upgrades**: Ubuntu Server enables it by default, and when it breaks + (a conffile prompt, a held package, a disabled timer) nothing shows until + security updates pile up. For hosts where it's **enabled** (the package is + installed and `APT::Periodic::Unattended-Upgrade` isn't `0`; leftover config + from a removed package doesn't count), the agent reports two timestamps from + `/var/lib/apt/periodic/`: `upgrade-stamp`, which apt's daily job touches only + when unattended-upgrades exits successfully, and `unattended-upgrades-stamp`, + which unattended-upgrades writes whenever a run gets far enough, even if it then + fails. No success in `unattended_upgrades_stale_after_days` (default 3) puts the + host in `update`, and the reason says which way it broke: "is failing" (it + runs, so read `/var/log/unattended-upgrades/` on the host) or "hasn't run" (check + `systemctl status apt-daily-upgrade.timer`). Packages it keeps back (held, + blacklisted, waiting on a conffile prompt) from + `/var/lib/unattended-upgrades/kept-back` are noted. Hosts where it's disabled or + not installed aren't affected; the host page shows which. It assumes the stock + `apt-daily-upgrade.timer` runs it: if you run `unattended-upgrade` from cron or + Ansible instead, the stamp isn't updated, so set + `unattended_upgrades_stale_after_days = 0`. Agents before 0.8.0 don't report it. - **Fresh package lists**: the simulation only knows what apt's package lists say, and the agent can't refresh them itself. Ubuntu refreshes them about once a day. Debian doesn't by default unless `unattended-upgrades` is set up, so a