kernelwatch-apt-update.service failed hourly on most hosts for weeks
without anything showing it. The agent only Wants= its helper units, so
the report goes out regardless, with stale lists or (for needrestart)
results that quietly turn "unknown".
Each helper (apt-update, needrestart) now runs kernelwatch-unit-result
as its ExecStopPost=, which systemd runs after failed runs too. It
writes "RESULT EXIT_CODE EXIT_STATUS FAILURES" to
/run/kernelwatch/<name>.result, FAILURES counting failed runs in a row.
The agent (0.10.0) reports results from the last two hours as
helper_units. On the server, one or two failures are a note (an admin's
apt can hold the lock now and then); three in a row put the host in
update, naming the unit and its exit status and pointing at journalctl.
The host page gets a "kernelwatch helpers" row.
The Livepatch unit isn't tracked: it fails by design where the snap is
installed but Livepatch isn't enabled, and Livepatch has its own check.
The apt-update unit now has RuntimeDirectory=kernelwatch (preserved,
like the others) for its result file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With User=root, NoNewPrivileges=yes and any seccomp-based sandbox option
together, apt 2.7+ (Ubuntu 24.04+, Debian 13) can't drop to _apt:
E: seteuid 42 failed - seteuid (1: Operation not permitted)
E: Method http has died unexpectedly!
so apt-get update exited 100 on every run on 10 of 13 hosts. The '-'
prefix hid it, and apt touches lists/partial even when it fails, so the
agent's list age looked fresh. Only hosts with older apt (22.04, Debian
12) refreshed. On Ubuntu apt-daily kept the lists fresh regardless; a
Debian 13 host relying on this unit alone had lists three days old.
Root is the default, so drop User=root. Let a failed update fail the
unit (the agent only Wants= it, so the report still goes), and touch
/var/lib/apt/periodic/update-success-stamp, the stamp Ubuntu writes after
each successful apt update, only when it succeeds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The agent's dist-upgrade simulation already finds new-ABI kernels and
security updates, but only once apt's lists know about them. Debian
doesn't refresh lists by default, so a kernel security release could
stay invisible until someone ran apt update.
install.sh --with-apt-update adds a marker that enables
kernelwatch-apt-update.service, a sandboxed root oneshot the agent pulls
in before each report. Failures (no network, apt lock held) are ignored
so the report still goes out. deploy.sh now ships the unit; a test keeps
deploy.sh's file list in sync with what install.sh uses.
Agent 0.3.2, server 0.3.3.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>