myxce/src/tools
Rongsong Shen 7b274ec0df
fix(deploy-ha): stop-all.sh/cleanup.sh must find the real worker regardless of sudo process-tree depth (bug-1823)
bug-1820's own fix assumed sudo always forks exactly one direct child
that IS the real target, and looked for it via `pgrep -P $PID` (direct
children only). On a real host, sudo commonly interposes an additional
"monitor" process between the invoked sudo and the actual target
(sudo -> monitor -> target, three processes, not two -- standard
sudo 1.8.7+ architecture for signal/exit-status relay) -- a shape this
sandbox's own simpler sudo build doesn't reproduce, which is why
bug-1820 verified clean here but still left the real worker orphaned
on the reporting user's box. `pgrep -P` found and killed the monitor
(a direct child) while the actual worker (the monitor's own child, not
a direct child of the pidfile'd PID) survived untouched.

Replaces the parent/child tree-walking approach entirely with a
depth-independent identity-based re-scan: both generated scripts now
search system-wide (pgrep -f) for any still-running process whose own
cmdline matches the worker's distinguishing identity (-n $NAME plus
this deploy's -l $TOP/logs -- the same two args start-worker.sh's own
"already running" guard checks) and kill every match directly, however
many hops deep it landed. No longer needs to know or guess sudo's
internal process-tree depth.

Live-verified: regression-checked against this sandbox's own real
(2-level) sudo deploy (still clean), and built + killed a synthetic
3-level process tree modeled on the user's exact live report,
confirming the deepest process is found directly and the intermediate
hop then exits on its own once its child is gone.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLSNJhNoULvVcUhXEFafQC
2026-09-17 04:20:03 +00:00
..
appimage save works 2026-03-04 18:18:53 +08:00
deploy-ha.sh fix(deploy-ha): stop-all.sh/cleanup.sh must find the real worker regardless of sudo process-tree depth (bug-1823) 2026-09-17 04:20:03 +00:00
go_build build: make Go and Python builds fully offline (hermetic Nix build) 2026-09-03 12:38:49 +08:00
test-build-version-regression.sh test(build-time-versioning): add motivating-incident regression script 2026-08-20 15:14:21 +00:00
test-commit-durability.sh fix: repoint stale controller/xce_test path references to harness/xce_test 2026-09-14 11:49:01 +00:00
test-dirty-fingerprint-distinguishability.sh test(dirty-content-fingerprint): add dev-loop distinguishability regression 2026-08-21 09:56:12 +00:00
test-dirty-fingerprint-nix-production-path.sh test(dirty-content-fingerprint): add Nix production path fingerprint check 2026-08-21 11:12:15 +00:00
test-dirty-fingerprint-startup-log-unchanged.sh test(dirty-content-fingerprint): add startup-log-unchanged consistency check 2026-08-21 10:17:39 +00:00
test-heartbeat-tolerance.sh feat(admin-config-tool): drop ha/data/ entirely, match real client TLS 2026-07-22 14:50:51 +00:00
test-version-startup-consistency.sh test(build-time-versioning): add version/startup-log consistency check 2026-08-20 16:38:37 +00:00
test-xceadmin-build-install-version.sh test(build-time-versioning): add xceadmin end-to-end build/install/version cycle check 2026-08-20 17:02:01 +00:00
xce-build.sh feat(xce-build): default --jobs to a live-computed value when omitted 2026-09-15 09:19:55 +00:00