You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: verify the installed Cortex service survives reboot on macOS and Linux #964
A tool meant to sit in your request path all day has to come back by itself after the machine
restarts. If it does not, the user's next agent session either fails or — worse — silently
bypasses Cortex, and they lose a day of data without noticing.
This is currently one checkbox inside the macOS install issue (#944) and one inside the Linux
install issue (#945), which is how it ends up verified by neither. It also cannot be covered by
the release smoke tests (#956, #957): CI runners do not reboot, so this is deliberate manual
verification on real machines.
Proposed Solution
Verify on macOS (launchd) and Linux (systemd):
Service auto-starts after a clean reboot, with no user action
Service auto-starts after an unclean shutdown or hard power cycle
macOS: comes back after logout then login, and after a reboot where the user has not yet
logged in — state which of those launchd actually guarantees for a gui/$uid domain
Linux: comes back under user systemd, and state what happens without enable-linger
abctl service status reports healthy after reboot, and the proxy is listening
The agent works after reboot without re-running enable — the settings patch and CA
trust both survive
Part of the Cortex v0.9.0 release, P0. Complements #944 and #945 — those cover install, upgrade
and uninstall mechanics; this covers the machine restarting underneath a working install.
Manual verification by design. Record the platforms and OS versions actually tested.
Ran the Linux half of this manually against a real VM (alan@192.168.64.3, Ubuntu, main-latest), using a new script: scripts/dev/verify-reboot-lingering.sh, submitted in #1409.
Why a script instead of just doing it by hand: this needs a real reboot with nobody logged in, which neither ci.yaml's agentop leg nor release-smoke-linux.yaml can exercise — both enable systemd lingering themselves beforeinstall.sh runs, so Cortex's own "turn lingering on and remember that I did" branch never fires there, and GitHub-hosted runners can't be rebooted anyway.
What it checked, and the results:
Fresh install claims lingering. Starting from Linger=no, installing Cortex turned lingering on and wrote the linger-enabled-by-agentop marker recording that it did so. ✅
Survives a real reboot, timed. 5 real reboot cycles, each timed via monotonic clocks on both ends (ActiveEnterTimestampMonotonic for the user manager + cortex.service, /proc/uptime at first successful healthz) — no wall-clock skew to account for. Boot-to-healthy:
Lingering-ownership edge cases (uninstall shouldn't clobber a preference it didn't set):
Uninstall turned lingering back off, since Cortex itself had enabled it. ✅
Installing onto a host that already had lingering on (simulating an unrelated pre-existing preference) did not write the ownership marker. ✅
Uninstalling from that state left the pre-existing lingering preference untouched. ✅
Host was restored to its original Linger=no baseline afterward.
This covers the Linux reboot-survival half of this issue. Not covered here: the macOS equivalent, unclean shutdown/power-cycle (vs. a clean reboot), and session/metrics persistence across the restart — happy to pick those up separately if useful.
Updated 2026-10-21: the first version of this comment claimed more than its evidence showed. Its timings were taken after the script's own SSH login, which starts the user manager, and Cortex with it, whether lingering works or not (huang195's review on #1409). The script now checks the host's own records instead. The figures below come from that version, run on a different VM.
Ran the Linux half of this manually against a real VM (Ubuntu 26.10, aarch64, systemd 261, main-latest), using scripts/dev/verify-reboot-lingering.sh from #1409.
Why a script instead of doing it by hand: this needs a real reboot with nobody logged in. Neither ci.yaml's agentop leg nor release-smoke-linux.yaml can do that. Both enable systemd lingering themselves beforeinstall.sh runs, so Cortex's own "turn lingering on and remember that I did" branch never fires there, and GitHub-hosted runners can't be rebooted anyway.
What it checked, and the results:
Fresh install claims lingering. Starting from Linger=no, installing Cortex turned lingering on and wrote the linger-enabled-by-agentop marker recording that it did. ✅
Survives a real reboot, through lingering. 5 real reboots. For each one, the script compared when user@1000.service and cortex.service became active with when the boot's first login session opened, both on the since-boot clock as the host recorded them. It stayed off the host for 30 s after each reboot so the two times are far apart:
On every boot, Cortex was up 23.6–28.9 s before anyone logged in, so lingering started it. ✅ The first summary line is the figure to quote. The second is when the script's health probe first got an answer, which can't happen before the 30 s wait ends.
Lingering-ownership edge cases (uninstall shouldn't undo a preference it didn't set):
Uninstall turned lingering back off, since Cortex itself had enabled it. ✅
Installing onto a host that already had lingering on did not write the ownership marker. ✅
Uninstalling from that state left the pre-existing lingering preference untouched. ✅
The host was restored to its original Linger=no baseline afterwards.
This covers the Linux reboot-survival half of this issue. Not covered here: the macOS equivalent, unclean shutdown or power loss (as opposed to a clean reboot), and session/metrics persistence across the restart. Happy to pick those up separately if useful.
Activity
Alan-Cha commentedon Oct 15, 2026
Ran the Linux half of this manually against a real VM (alan@192.168.64.3, Ubuntu,main-latest), using a new script:scripts/dev/verify-reboot-lingering.sh, submitted in #1409.Why a script instead of just doing it by hand: this needs a real reboot with nobody logged in, which neither
ci.yaml's agentop leg norrelease-smoke-linux.yamlcan exercise — both enable systemd lingering themselves beforeinstall.shruns, so Cortex's own "turn lingering on and remember that I did" branch never fires there, and GitHub-hosted runners can't be rebooted anyway.What it checked, and the results:
Fresh install claims lingering. Starting from
Linger=no, installing Cortex turned lingering on and wrote thelinger-enabled-by-agentopmarker recording that it did so. ✅Survives a real reboot, timed. 5 real reboot cycles, each timed via monotonic clocks on both ends (
ActiveEnterTimestampMonotonicfor the user manager +cortex.service,/proc/uptimeat first successfulhealthz) — no wall-clock skew to account for. Boot-to-healthy:Lingering-ownership edge cases (uninstall shouldn't clobber a preference it didn't set):
Host was restored to its original
Linger=nobaseline afterward.This covers the Linux reboot-survival half of this issue. Not covered here: the macOS equivalent, unclean shutdown/power-cycle (vs. a clean reboot), and session/metrics persistence across the restart — happy to pick those up separately if useful.Ran the Linux half of this manually against a real VM (Ubuntu 26.10, aarch64, systemd 261,
main-latest), usingscripts/dev/verify-reboot-lingering.shfrom #1409.Why a script instead of doing it by hand: this needs a real reboot with nobody logged in. Neither
ci.yaml's agentop leg norrelease-smoke-linux.yamlcan do that. Both enable systemd lingering themselves beforeinstall.shruns, so Cortex's own "turn lingering on and remember that I did" branch never fires there, and GitHub-hosted runners can't be rebooted anyway.What it checked, and the results:
Fresh install claims lingering. Starting from
Linger=no, installing Cortex turned lingering on and wrote thelinger-enabled-by-agentopmarker recording that it did. ✅Survives a real reboot, through lingering. 5 real reboots. For each one, the script compared when
user@1000.serviceandcortex.servicebecame active with when the boot's first login session opened, both on the since-boot clock as the host recorded them. It stayed off the host for 30 s after each reboot so the two times are far apart:On every boot, Cortex was up 23.6–28.9 s before anyone logged in, so lingering started it. ✅ The first summary line is the figure to quote. The second is when the script's health probe first got an answer, which can't happen before the 30 s wait ends.
Lingering-ownership edge cases (uninstall shouldn't undo a preference it didn't set):
The host was restored to its original
Linger=nobaseline afterwards.This covers the Linux reboot-survival half of this issue. Not covered here: the macOS equivalent, unclean shutdown or power loss (as opposed to a clean reboot), and session/metrics persistence across the restart. Happy to pick those up separately if useful.
Test: Prove the reboot came up through lingering, not a login (#964)
Test: Add a real-reboot verification script for Linux lingering (ross…