Skip to content

emrg: deprecate emrgd.pid/emrgd.port in uninstaller (fixed-port + token ground truth) - #978

Merged
argszero merged 1 commit into
masterfrom
feature/deprecate-emrgd-pid-port
Aug 25, 2026
Merged

emrg: deprecate emrgd.pid/emrgd.port in uninstaller (fixed-port + token ground truth)#978
argszero merged 1 commit into
masterfrom
feature/deprecate-emrgd-pid-port

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Fully deprecate ~/.emrg/emrgd.pid / ~/.emrg/emrgd.port in the uninstaller (bin/emrg-uninstall), matching the daemon's long-standing behavior (host feedback 2026-08-25 18:46: the daemon no longer writes or reads these files).

Changes

  • bin/emrg-uninstallstop_daemon() rewrite:
    • Removed PORT_FILE / PID_FILE constants; the daemon is now identified solely by:
      • the fixed port 56031 (ground truth for daemon liveness, rant 2026-08-19T08:05:21), and
      • the token read from the single-line emrgd.token file (rant 2026-08-20T14:32:52).
    • Shutdown order: ① WebSocket protocol shutdown on the fixed port → ② command-line scan for -m emrg.server processes (ps / wmic+CIM) with SIGTERM/taskkill — the only remaining reliable identity marker, same semantics as emrg._stop_all.stop_daemon (rant 2026-08-17T17:03:38).
    • Port-close polling (≤5s) after SIGTERM confirms the daemon actually exited.
    • WHITELIST retains emrgd.pid/emrgd.port filenames only to clean up legacy residue from old installs during uninstall — never created or read.
  • packaging/make-installer.sh — comment update only: documents the fixed-port + token ground truth (emrgd.pid deprecated).

Verification

  • Local pytest: 1063 passed, 1 skipped
  • python -c "from emrg.client.app import run_client" OK; python -m emrg --help OK
  • Logic verified in positive (protocol-shutdown → cmdline-scan fallback with port-poll) and negative (no pids → token cleanup, graceful message) states
  • emrg/server/daemon.py confirmed to no longer write/read emrgd.pid/emrgd.port (only a docstring mention remains); ~/.emrg/ contains only emrgd.token today

Notes

  • This work was authored by a parallel evolution instance at 18:48 and left uncommitted; this cycle adopted it after confirming it had been static >10 minutes and no PR/branch existed. The fix is consistent with the daemon's current state.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 20260825-190924. CI: test + test-windows both pass. Verified stop_daemon logic in both states (protocol shutdown → cmdline-scan fallback with port-poll; no-pids → token cleanup); daemon confirmed to no longer write/read emrgd.pid/emrgd.port; full local suite 1071 passed/1 skipped + import + CLI OK. Consistent with emrg._stop_all semantics.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 20260825-192404. CI green (test + test-windows). Re-verified stop_daemon in both states (protocol shutdown → cmdline-scan fallback + port poll; no-pids → token cleanup) and daemon consistency (no emrgd.pid/port reads remain). Local suite green.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 20260825-193548 (3rd consecutive LGTM: 190924, 192404, 193548; no ❌ between). CI green (test + test-windows). PR remains limited to bin/emrg-uninstall + packaging/make-installer.sh — no daemon pid/port reads remain (verified ~/.emrg has only emrgd.token; daemon.py only docstring mention). Merge condition met.

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.

1 participant