Unblock native XYZAC TP oracle

This commit is contained in:
2026-08-31 20:08:00 +08:00
parent 18436149a2
commit 6015293ee9
17 changed files with 49339 additions and 61 deletions

View File

@@ -100,10 +100,20 @@ def cleanup_linuxcnc_services() -> dict[str, object]:
pass
lock = Path("/tmp/linuxcnc.lock")
lock_removed = False
lock_backup = None
if lock.exists() and not any(service_pattern.search(command) for _, command in process_rows()):
lock.unlink()
# Preserve stale lock evidence for post-mortem inspection. A lock is
# runtime state, not a repository artifact, so moving it is sufficient
# and recoverable while allowing the next source launcher to start.
lock_backup_path = Path(f"/tmp/linuxcnc.lock.stale-{time.strftime('%Y%m%d-%H%M%S')}")
suffix = 1
while lock_backup_path.exists():
lock_backup_path = Path(f"/tmp/linuxcnc.lock.stale-{time.strftime('%Y%m%d-%H%M%S')}-{suffix}")
suffix += 1
lock.rename(lock_backup_path)
lock_removed = True
return {"commands": commands, "killed_pids": killed, "lock_path": lock.as_posix(), "lock_removed": lock_removed, "remaining_services": [command for _, command in process_rows() if service_pattern.search(command)]}
lock_backup = lock_backup_path.as_posix()
return {"commands": commands, "killed_pids": killed, "lock_path": lock.as_posix(), "lock_removed": lock_removed, "lock_backup": lock_backup, "remaining_services": [command for _, command in process_rows() if service_pattern.search(command)]}
def run(screenshot_path: Path | None = None) -> dict[str, object]: