Session-trace timer needs a calendar trigger; it stops after the user manager restarts #116
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/archetypes#116
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The hourly session-trace timer keeps firing after a logout or a user-manager restart, instead of going silent until the next reboot.
Primary goals:
modules/memory-traces.nixschedules the timer withOnCalendar(defaulthourly) andPersistent=true, keepsOnBootSec=10min, and dropsOnUnitActiveSec.checks/memory-traces.nixresolves theOnCalendarvalue out of the generated timer and runssystemd-analyze calendaron it, so a missing realtime trigger or an expression that does not parse fails the build; a sabotage run shows the check can fail.Current state and specifics
modules/memory-traces.nix:63-70declaresOnBootSec=10min,OnUnitActiveSec=<interval>andPersistent=true. Both triggers are monotonic. When the systemd user manager restarts, which happens at every logout on a machine without lingering, the new manager finds the boot offset already in the past and has no activation of its own to count the interval from, so it reports the timeractive (elapsed)withTrigger: n/aand never fires it again until reboot.Persistent=truedoes nothing here: it only applies toOnCalendar.On one dev VM the timer ran exactly once, ten minutes after boot, and then sat elapsed for three days while fifteen sessions went uncaptured.
checks/memory-traces.nix:39-41greps for the three timer lines and stayed green throughout, because it witnesses the text of the unit rather than its schedule (testing.md, the generated-artifact rule).Evidence from the machine:
journalctl --user -bshows threeStartup finishedlines from three manager PIDs that day; the last manager started at 17:21, after the 16:42 run, and owns the elapsed timer.The change:
OnCalendar = intervalwithintervaldefaulting tohourly;Persistent = truestays and now means something, since a run missed while no manager was running fires as soon as one starts;OnBootSec = 10minstays so a fresh boot captures within minutes. The check extracts theOnCalendarline and executessystemd-analyze calendar <value>frompkgs.systemd, failing when the line is absent or the expression does not parse; the existing assertions, including executing the binary the wrapper names and the distil-before-network ordering, stay. A sabotage run with the calendar line removed must fail the build with a message naming the missing realtime trigger.Lingering (
loginctl enable-linger) would also keep the manager alive across logouts, but it changes the lifetime of every user service on the machine, and a persistent calendar trigger already closes this gap on its own, so it is not part of this change.Scope
In: the module, its check, the README section. Part of allod/strategy#55. Which machines enable the timer is a deployment matter and is tracked privately.
The machine witness this change left open — "Not run: the timer surviving a real logout on a machine, which needs this merged and the deploy pin advanced" — has now been observed. The deployment advanced its
archetypespin tofc53400, master's tip, and a dev VM was rebuilt on it.The observation lands on the same user-manager instance that produced the evidence in the body above. The machine has not rebooted since: boot was 2026-09-20 16:31:53, uptime is over three days, and the user manager is the third of that boot, started 17:21:16 — the one the body quotes as owning an
active (elapsed)timer withTrigger: n/a.Under the merged module, that same manager now reports:
and the generated unit carries all three clauses:
What this proves: a user manager started well after boot arms the wall-clock trigger. That is exactly the failure described here — the old monotonic pair left such a manager with no activation to count an interval from, and the boot offset already in the past.
What it does not prove: that a future logout re-arms it. No logout has happened since the rebuild. It follows from
OnCalendarbeing absolute rather than relative to a manager activation, but that is inference from the mechanism, not a second observation.All three scoped items are on master: the module's
OnCalendartrigger withPersistent=trueandOnBootSec=10minretained, the check resolving the value out of the generated timer and executingsystemd-analyze calendaron it, and the README section stating why a monotonic-only trigger is not enough.