Add reclaim_own_port: if the service addr is held by a process whose cmdline ancestry matches pidcheck/ENV_BIN, stop it before start/install
Wire into do_stop / do_stop_quiet, check_port_free, and install_artifacts (refuse overwrite while own orphan holds the port)
Distinguish error text: own residual vs foreign occupant
Why
genui update cleared svc.pid without killing the process, cp left exe (deleted), and start failed with a false 「非本服务」.
Ops
Orphan on 8973 killed; genui redeployed to dev@4c5dd3d (running).
Evidence
make test-governance SELF receipt /tmp/svc-reclaim-governance2.json exit=0 (task card)
Test plan
test_start_reclaims_own_orphan_without_pidfile
test_start_rejects_foreign_port_occupant
full make test-governance
## Summary
- Add `reclaim_own_port`: if the service addr is held by a process whose cmdline ancestry matches `pidcheck`/`ENV_BIN`, stop it before start/install
- Wire into `do_stop` / `do_stop_quiet`, `check_port_free`, and `install_artifacts` (refuse overwrite while own orphan holds the port)
- Distinguish error text: own residual vs foreign occupant
## Why
`genui` update cleared `svc.pid` without killing the process, `cp` left `exe (deleted)`, and start failed with a false 「非本服务」.
## Ops
- Orphan on 8973 killed; `genui` redeployed to `dev@4c5dd3d` (running).
## Evidence
- `make test-governance` SELF receipt `/tmp/svc-reclaim-governance2.json` exit=0 (task card)
## Test plan
- [x] `test_start_reclaims_own_orphan_without_pidfile`
- [x] `test_start_rejects_foreign_port_occupant`
- [x] full `make test-governance`
Why: establish the authorized task workspace and its initial baseline.
Evidence: preserved precheck receipt in .task/fix-svc-reclaim-own-port.md; R0=8504b88ace66d709f27339887d6d9ecff610f77c.
Impact: task metadata only; the feature workspace starts at 8504b88ace.
Refs: .task/fix-svc-reclaim-own-port.md
Why: genui update cleared svc.pid without killing the process, then
overwrote the binary and failed start with a false "non-ours" port error.
Evidence: make test-governance (receipt /tmp/svc-reclaim-governance.json)
Impact: reclaim_own_port walks ss listener ancestry; stop/check_port/install
wire it; orphans matching pidcheck are stopped, foreign occupants still refused
Refs: fix/svc-reclaim-own-port
Co-authored-by: Cursor <cursoragent@cursor.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
reclaim_own_port: if the service addr is held by a process whose cmdline ancestry matchespidcheck/ENV_BIN, stop it before start/installdo_stop/do_stop_quiet,check_port_free, andinstall_artifacts(refuse overwrite while own orphan holds the port)Why
genuiupdate clearedsvc.pidwithout killing the process,cpleftexe (deleted), and start failed with a false 「非本服务」.Ops
genuiredeployed todev@4c5dd3d(running).Evidence
make test-governanceSELF receipt/tmp/svc-reclaim-governance2.jsonexit=0 (task card)Test plan
test_start_reclaims_own_orphan_without_pidfiletest_start_rejects_foreign_port_occupantmake test-governance