Unblock native XYZAC TP oracle
This commit is contained in:
@@ -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]:
|
||||
|
||||
Reference in New Issue
Block a user