Files
kernel-automation/tests
patrickandClaude Opus 5.5 195fd035e0 Fix kernelwatch-apt-update failing on apt 2.7+
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>
2026-11-01 14:52:36 -05:00
..