Hosts with Ubuntu Livepatch were flagged reboot permanently once a newer
kernel was installed, even though the running kernel stays patched. The agent
now collects Livepatch status and the server uses it.
If Livepatch is healthy (applied/nothing-to-apply, checked, supported)
and the kernel's UpgradeRequiredDate is more than 14 days away, a pending
kernel reboot, or a /run/reboot-required caused only by linux-* packages,
is shown as a note (with the deadline) instead of reboot.
Other reboot reasons (libc, systemd) still count.
Unhealthy, unsupported or unrecognised Livepatch state gives no cover and is
noted. No new status level, since the full state list is unknown.
Host page shows a Livepatch line.
Agent (0.4.0)
kernelwatch-livepatch.service runs canonical-livepatch status as root, no
network, read-only filesystem, and a small python3 helper writes the running
kernel's fields to /run/kernelwatch/livepatch. Skipped when the snap isn't
installed. The unprivileged agent unit reads the file like needrestart's and
never runs the snap itself.
NoNewPrivileges=yes can't be used: snap-confine fails with "cannot change
profile for the next exec call" (tested on Ubuntu 22.04). The sandbox matches
the combination that worked: PrivateNetwork, ProtectSystem=strict,
PrivateTmp, ProtectHome=read-only. Documented in the README.
Rollout
Deploy the server first (an old server ignores the new fields). Hosts show the
"agent older than 0.4.0" note until redeployed with agent/deploy.sh.
Testing
make test: 136 tests pass. The helper is tested against real canonical-livepatch status --format json output from Ubuntu 22.04 (applied)
and 24.04 (nothing-to-apply) hosts, including malformed input and line
injection. Status tests cover cover/no cover, the 14-day boundary, unhealthy
states, and kernel-only vs other reboot-required packages. A test checks every
agent field is accepted by the server.
Not yet run on a real host: the systemd unit itself (verify with systemctl start kernelwatch-livepatch on a Pro host). make lint couldn't run
locally; CI covers it.
## Summary
Hosts with Ubuntu Livepatch were flagged `reboot` permanently once a newer
kernel was installed, even though the running kernel stays patched. The agent
now collects Livepatch status and the server uses it.
**Server**
- New `livepatch_*` report fields (state, check state, supported, end-of-support
date, fix count).
- If Livepatch is healthy (`applied`/`nothing-to-apply`, `checked`, `supported`)
and the kernel's `UpgradeRequiredDate` is more than 14 days away, a pending
kernel reboot, or a `/run/reboot-required` caused only by `linux-*` packages,
is shown as a note (with the deadline) instead of `reboot`.
- Other reboot reasons (libc, systemd) still count.
- Unhealthy, unsupported or unrecognised Livepatch state gives no cover and is
noted. No new status level, since the full state list is unknown.
- Host page shows a Livepatch line.
**Agent (0.4.0)**
- `kernelwatch-livepatch.service` runs `canonical-livepatch status` as root, no
network, read-only filesystem, and a small python3 helper writes the running
kernel's fields to `/run/kernelwatch/livepatch`. Skipped when the snap isn't
installed. The unprivileged agent unit reads the file like needrestart's and
never runs the snap itself.
- `NoNewPrivileges=yes` can't be used: snap-confine fails with "cannot change
profile for the next exec call" (tested on Ubuntu 22.04). The sandbox matches
the combination that worked: PrivateNetwork, ProtectSystem=strict,
PrivateTmp, ProtectHome=read-only. Documented in the README.
## Rollout
Deploy the server first (an old server ignores the new fields). Hosts show the
"agent older than 0.4.0" note until redeployed with `agent/deploy.sh`.
## Testing
`make test`: 136 tests pass. The helper is tested against real
`canonical-livepatch status --format json` output from Ubuntu 22.04 (applied)
and 24.04 (nothing-to-apply) hosts, including malformed input and line
injection. Status tests cover cover/no cover, the 14-day boundary, unhealthy
states, and kernel-only vs other reboot-required packages. A test checks every
agent field is accepted by the server.
Not yet run on a real host: the systemd unit itself (verify with
`systemctl start kernelwatch-livepatch` on a Pro host). `make lint` couldn't run
locally; CI covers it.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
patrick
added 2 commits 2026-10-30 01:39:39 +00:00
New livepatch_* report fields. When Livepatch is healthy (applied or
nothing-to-apply, checked, supported) and the kernel's support end date is
more than 14 days away, a pending kernel reboot, or a reboot-required file
caused only by linux-* packages, becomes a note instead of the reboot status.
Anything else about Livepatch gives no cover and is noted.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
kernelwatch-livepatch.service runs canonical-livepatch as root with no
network and a read-only filesystem, and a small python3 helper keeps the
running kernel's state, check state, support, end-of-support date and fix
count in /run/kernelwatch/livepatch. The agent (0.4.0) reads that file the
way it reads needrestart's and never runs the snap itself.
NoNewPrivileges=yes can't be used: snap-confine fails under it.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
patrick
merged commit 3e62d086d1 into main2026-10-30 01:45:30 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Hosts with Ubuntu Livepatch were flagged
rebootpermanently once a newerkernel was installed, even though the running kernel stays patched. The agent
now collects Livepatch status and the server uses it.
Server
livepatch_*report fields (state, check state, supported, end-of-supportdate, fix count).
applied/nothing-to-apply,checked,supported)and the kernel's
UpgradeRequiredDateis more than 14 days away, a pendingkernel reboot, or a
/run/reboot-requiredcaused only bylinux-*packages,is shown as a note (with the deadline) instead of
reboot.noted. No new status level, since the full state list is unknown.
Agent (0.4.0)
kernelwatch-livepatch.servicerunscanonical-livepatch statusas root, nonetwork, read-only filesystem, and a small python3 helper writes the running
kernel's fields to
/run/kernelwatch/livepatch. Skipped when the snap isn'tinstalled. The unprivileged agent unit reads the file like needrestart's and
never runs the snap itself.
NoNewPrivileges=yescan't be used: snap-confine fails with "cannot changeprofile for the next exec call" (tested on Ubuntu 22.04). The sandbox matches
the combination that worked: PrivateNetwork, ProtectSystem=strict,
PrivateTmp, ProtectHome=read-only. Documented in the README.
Rollout
Deploy the server first (an old server ignores the new fields). Hosts show the
"agent older than 0.4.0" note until redeployed with
agent/deploy.sh.Testing
make test: 136 tests pass. The helper is tested against realcanonical-livepatch status --format jsonoutput from Ubuntu 22.04 (applied)and 24.04 (nothing-to-apply) hosts, including malformed input and line
injection. Status tests cover cover/no cover, the 14-day boundary, unhealthy
states, and kernel-only vs other reboot-required packages. A test checks every
agent field is accepted by the server.
Not yet run on a real host: the systemd unit itself (verify with
systemctl start kernelwatch-livepatchon a Pro host).make lintcouldn't runlocally; CI covers it.
🤖 Generated with Claude Code