Skip to content

feature: verified Linux install and systemd service lifecycle #945

Open

Description

@huang195

Feature Description

Same goal as the macOS install issue, on the systemd path, which shares none of launchd's code.

Proposed Solution

  • Fresh install via curl | sh, amd64 and arm64
  • Upgrade over an older install: service restarted, config preserved
  • Uninstall leaves no unit file; ~/.cortex (config, CA) is explicitly preserved,
    not wiped
  • Uninstall reverts agent settings automatically — today it does not: agentop configure <agent> disable is a separate, manual step (relates to feature: agent integration contract — reusable detection, settings patching, and revert #939)
  • Re-running install is idempotent
  • Service survives reboot and a crash
  • abctl service status | start | stop | restart accurate in every state
  • stop tolerates the proxy's ~15s drain
  • Works under user systemd, and states what happens where systemd is absent

Additional Context

Part of the Cortex v0.9.0 release. Gates exit criterion 1 (install works cold). Automated by
the Linux release smoke test.

Activity

  1. added this to the Release V0.9.0 milestone on Sep 10, 2026
  2. Alan-Cha commented on Sep 23, 2026

    @Alan-Cha
    Member

    Status update from the #1076/#1079/#1080 (+follow-up #1107) review cycle, full analysis in authbridge/docs/superpowers/specs/2026-09-16-linux-systemd-lifecycle-design.md:

    Closed:

    Partial, not checking off yet:

    Untouched:

    • Fresh install via curl \| sh on a real Linux box, and upgrade-over-existing against a real running unit — both need actual CI infrastructure, likely belongs with test: release smoke test on Linux CI runners #957 (Linux release smoke test) rather than this issue.
    • No Linux equivalent of launchdUsable()'s clean preflight — explicitly left as an open decision in the design doc, not yet resolved either way.
  3. Alan-Cha commented on Sep 23, 2026

    @Alan-Cha
    Member

    #1108 addresses the last untouched bullet — "Works under user systemd, and states what happens where systemd is absent" — by adding systemdUsable() (the Linux equivalent of launchdUsable()) and wiring it into serviceInstall's existing preflight. Not checking the box until it merges.

  4. Alan-Cha commented on Sep 29, 2026

    @Alan-Cha
    Member

    #1108 merged — checking off "Works under user systemd, and states what happens where systemd is absent."

    Unrelated but worth flagging here: main has since undergone a large reorg (afb49e9f, "Flatten authbridge/ into the repo root") — authbridge/cmd/abctl/... is now just cmd/abctl/..., authbridge/authlib/ is now core/, etc. Our code landed before that and moved automatically with it, but the design doc's own path references (authbridge/cmd/abctl/cmd_service_platform.go etc.) still say authbridge/... and are now stale in prefix. Not fixing preemptively — flagging so whoever picks up the remaining bullets knows to use the new paths, and can fix the doc's prefixes as part of that work rather than as a separate no-op PR.

    Remaining, for reference:

    • Bullets 1-2 (fresh install + upgrade against real hardware) really belong to test: release smoke test on Linux CI runners #957 (Linux release smoke test CI), not this issue.
    • Bullet 3's remainder (full serviceUninstall end-to-end: unit file, stamp file, ~/.cortex actually removed) and bullet 6's remainder (a real-systemd integration test that drives loadService/controlService/supervisorRunning themselves, not just raw systemctl — the actual analog of TestWaitBootedOut_RealLaunchd) are the two pieces of actual #945-scoped work still open.
    • Bullet 5's reboot half is tracked in test: verify the installed Cortex service survives reboot on macOS and Linux #964, not here (CI runners don't reboot).
  5. Alan-Cha commented on Oct 7, 2026

    @Alan-Cha
    Member

    Checked off the upgrade box — now covered end-to-end by the Linux release smoke test (#957, landed in #1288): assert_running_binary_is_current + assert_running_version_is confirm the systemd unit is actually running the newly-installed binary post-upgrade (not a stale process, the exact #1203-class regression this is guarding against), and a config marker confirms the config survives untouched.

  6. Alan-Cha commented on Oct 8, 2026

    @Alan-Cha
    Member

    Split and corrected the uninstall bullet: the original wording bundled 'no unit file, no ~/.cortex, no modified agent settings' as one guarantee. In practice:

    • unit file removal + leaving ~/.cortex (config, CA) untouched is done and tested (checksum comparison in the Linux release smoke test) — checked that half.
    • reverting agent settings is NOT automatic on uninstall. serviceUninstall explicitly tells the user to separately run agentop configure claude-code disable / agentop configure opencode disable — left that half unchecked and split out as its own line, since it's a real gap (or a deliberate scoping decision someone should confirm), not a wording issue. Possibly belongs with feature: agent integration contract — reusable detection, settings patching, and revert #939's settings-revert work.
  7. Alan-Cha commented on Oct 15, 2026

    @Alan-Cha
    Member

    #1405 adds the arm64 half of "Fresh install via curl | sh, amd64 and arm64" — matrix-izes the Linux release smoke test (#957) to also run on GitHub's ubuntu-24.04-arm runner, exercising the exact same fresh-install/upgrade/uninstall path install.sh's own uname -m detection and release-binaries.yaml's linux/arm64 tarballs already support. Not checking the box until it merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions