Skip to main content
← Back to list
01Issue
FeatureShippedSwamp CLI
Assigneesstack72

Relationships

#715 Add macOS launchd integration for swamp serve

Opened by bixu · 6/20/2026· Shipped 6/25/2026

Currently swamp serve must be started manually (nohup swamp serve >> server.log 2>&1 &) and dies with the shell session. There's no supervised restart on crash, no auto-start on login, and no clean shutdown sequencing.

This morning we hit a failure mode where:

  1. We killed the running daemon to load new model code
  2. Started a new daemon immediately
  3. Old daemon was still finishing in-flight work and holding port 9090
  4. New daemon FATAL'd with EADDRINUSE and exited
  5. Old daemon eventually finished and shut down
  6. Pipeline went silent — no daemon running at all

A proper launchd integration would prevent this entire class of failure.

Requested

  • swamp serve install (or similar) command that drops a .plist into ~/Library/LaunchAgents/ (per-user) or /Library/LaunchDaemons/ (system-wide)
  • Generated plist should set:
    • RunAtLoad: true — auto-start at login
    • KeepAlive: true — respawn on crash
    • StandardOutPath / StandardErrorPath to a configurable log path
    • Working directory, env vars (SWAMP_REPO_DIR, etc.)
  • swamp serve uninstall to remove the plist and unload
  • swamp serve status to show daemon state (running, last restart, port binding)
  • Optionally: graceful shutdown that drains in-flight workflows before releasing the port — prevents the EADDRINUSE race with a restart

Linux equivalent

Same concept via systemd --user unit file would be nice for symmetry, but macOS is the immediate ask.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 3 MOREPR_MERGED+ 1 MORECONTRIBUTOR_NOTIFIED

Shipped

6/25/2026, 2:26:08 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack726/24/2026, 10:59:08 PM
Editable. Press Enter to edit.

stack72 commented 6/25/2026, 2:26:35 PM

Thanks @bixu for reporting this! The fix has been merged and a release is on its way. We appreciate your contribution to swamp.

Sign in to post a ripple.