Skip to content

v0.5.615 — PM2 launchd autostart self-heal

Latest

Choose a tag to compare

@ope-olatunji ope-olatunji released this 05 Jun 23:52

What's new

Self-healing PM2 autostart on macOS reboots.

Stock pm2 startup ships a launchd plist with LaunchOnlyOnce=true — a deprecated key that launchd interprets as "run once in the entire lifetime of the plist." After the first boot it never fires again, so reboots silently stopped resurrecting the PM2 process list. Users hit this regularly: "my Mac rebooted and PM2 is empty."

This release ships a fix that runs automatically on install.

Added

  • scripts/ensure-pm2-startup.cjs — standalone CJS helper that writes a correct launchd plist (RunAtLoad=true, KeepAlive=false, no LaunchOnlyOnce), captures the current $PATH + PM2_HOME, re-bootstraps the agent (launchctl bootout + bootstrap gui/<uid>), and runs pm2 save.
  • postinstall hook — runs the helper in --quiet mode on every install/upgrade. Best-effort: any error path swallows + exits 0 so install never aborts.
  • enterprise startup CLI subcommand (alias autostart) — manual repair when you need it.
  • --check mode — verify-only, exit code 2 if the plist needs fixup.

Why it matters

Before: PM2 would silently not restart your services after a macOS reboot. You'd discover it next time you tried to use your agents.

After: npm install -g @agenticmail/enterprise (or npm update) configures reboot autostart correctly. If something drifts later, enterprise startup repairs it.

🤖 Generated with Claude Code