Skip to content

Add background server lifecycle commands - #10

Merged
enowdev merged 2 commits into
enowdev:mainfrom
nvdorman:feature/daemon-lifecycle-pr
Aug 1, 2026
Merged

enowdev merged 2 commits into
enowdev:mainfrom
nvdorman:feature/daemon-lifecycle-pr

Conversation

@nvdorman

@nvdorman nvdorman commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make explicit antares serve detach by default and return after the child owns the configured listener and health is ready
  • add antares stop with graceful SIGTERM, bounded wait, and process-group SIGKILL escalation
  • add antares status with PID, dashboard URL, version, and daemon log path
  • preserve antares serve --foreground and bare headless antares for systemd, containers, and debugging
  • store atomic PID identity state under ANTARES_HOME and logs at ~/.antares/logs/daemon.log
  • reject stale/reused PID files using kernel start time, UID, executable, command line, and socket ownership
  • adopt a legacy foreground antares serve listener so the first antares stop works after upgrade
  • serialize concurrent starts and reject occupied-port false readiness

CLI

antares serve               # starts in background and returns
antares status              # reports daemon status
antares stop                # graceful bounded shutdown
antares serve --foreground  # old attached behavior

Verification

  • make check
  • go test -race ./cmd/antares
  • real isolated lifecycle: start, health, status, duplicate start, stop, idempotent stop
  • occupied-port startup rejection with no stale PID state
  • Linux /proc listener-owner, UID, start-time, and upgraded/deleted executable handling
  • Darwin cross-build for foreground portability
  • read-only adoption test against a live pre-feature Antares instance

@enowdev
enowdev merged commit 9bd81cb into enowdev:main Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants