Build fleet duplicate-process cleanup script #16
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Scope
Detect and safely terminate duplicate wizard gateway processes when multiple PIDs are bound to overlapping ports.
Acceptance Criteria
hermes gatewayprocessesgateway.pidfiles for each wizard houseSIGTERM, fallbackSIGKILL/root/wizards/ezra/reports/fleet-cleanup-YYYYMMDD.logawareness_loop.pyas automated remediation (opt-in)Why
Currently a stray Ezra gateway occupies port 8640 while the canonical gateway runs on 8648. Manual cleanup is reactive.
Completed
tools/fleet_cleanup.pyhermes gatewayprocessesgateway.pidfiles for ezra, bezalel, allegro-primus/root/wizards/ezra/reports/fleet-cleanup-YYYYMMDD.logawareness_loop.pyas auto-remediation on duplicate-gateway detectionLive result: terminated orphan PID 901501 on ports 8640/8650.
Update: Bilbo discovered
During validation, the cleanup script initially flagged PID 932554 on ports 8640/8650 as an orphan. Root cause: Bilbo was not in the fleet config. Bilbo's gateway is canonical (systemd
hermes-bilbo.service) and hisgateway.pidis valid.fleet_cleanup.pyandawareness_loop.pyto include Bilbo in FLEET config