apt skips phasing in chroots, which it detects by running
`ischroot -t`. ischroot compares / with /proc/1/root; the agent's
DynamicUser can't read /proc/1/root, so ischroot answers "chroot"
(-t = assume yes when unsure) and apt offered every phased update.
On a real 26.04 host, 4 updates apt deferred as root were reported as
installable, with 0 phased.
Pass -o Dir::Bin::ischroot=/bin/false so apt applies phasing from
/etc/machine-id exactly as it does for root. Agent 0.3.1, server 0.3.2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
apt lists updates deferred by phasing in an indented block rather than
as Inst lines, so they were already excluded from the counts but
invisible. The agent now parses that block into phased_packages; the
dashboard shows "+N phased" in the Updates column (with a tooltip) and
the list on the host page. Phasing never affects status: Ubuntu doesn't
phase security updates, and there's nothing to act on until apt offers
the update.
Run the apt simulation with LC_ALL=C since we parse its messages (the
systemd unit already runs in the C locale; manual --print may not).
Agent and server 0.3.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
needrestart has to inspect every process, which an unprivileged agent
can't (and unprivileged it gave false kernel results). Add
kernelwatch-needrestart.service: root with only CAP_SYS_PTRACE and
CAP_DAC_READ_SEARCH, PrivateNetwork=yes, list-only (-r l). It writes
`needrestart -b` output to /run/kernelwatch/needrestart; the agent unit
pulls it in before each report and reads the file (ignored if older than
2h). The agent no longer runs needrestart itself. Skipped cleanly when
needrestart isn't installed: the dashboard shows "?" and status is
unaffected.
Server: services_need_restart / sessions_need_restart fields, an
"update"-level reason, a Services column, and a note (not an escalation)
for hosts running an agent older than the one shipped with the server.
install.sh --with-needrestart installs needrestart and sets it to list
services after apt upgrades instead of prompting; deploy.sh passes
anything after `--` to install.sh. Agent 0.2.0, server 0.2.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The agent ran as (capability-less) root only so needrestart could read
Ubuntu's root-only /boot images. Switch the unit to DynamicUser=yes and
make needrestart optional.
To cover the case needrestart was catching (running kernel's package
upgraded in place, same uname -r), the agent now reports the installed
package version of the running kernel and the server compares it with
the build in uname -v: "Debian 6.12.57-1" vs 6.12.57-1 on Debian,
"#85-Ubuntu" / "#33~24.04.1-Ubuntu" vs the upload part of 6.8.0-85.85 /
6.14.0-33.33~24.04.1 on Ubuntu. Unrecognised builds fall back to
needrestart and the newest-installed comparison.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent: bash script run hourly by a hardened systemd timer on Debian 12/13
and Ubuntu 24.04. Collects running vs installed kernel (needrestart when
available), pending/security updates via a read-only apt simulation,
reboot-required state and apt list freshness, and POSTs them as JSON.
Server: stdlib-only Python + SQLite (system python3 >= 3.11). Token-bound
ingest API, login-protected dashboard with per-host status
(stale/reboot/update/ok) and history, admin CLI, systemd unit and installer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>