Commit a64580b
committed
iOS inner loop: use per-call unique logarchive path to eliminate sudo rm hang
The previous code shared a single `ioshelper_startup.logarchive` path across
all iterations and bracketed the `sudo log collect` call with `sudo rm -rf`
calls to purge any stale archive (since `log collect` refuses to overwrite
an existing --output path with exit 74). That works when sudo credentials
are cached, but hangs indefinitely in non-TTY background contexts (e.g.,
campaigns started via detached caffeinate, nohup, or any agent runner)
because the sudo password prompt has no terminal to read from.
NOPASSWD is only practical to scope to `/usr/bin/log collect` (per the
existing /etc/sudoers.d/log-collect convention); scoping it to /bin/rm is
broader than most users want.
Switch to a per-call unique logarchive path
`ioshelper_startup_{pid}_{ms}.logarchive`. macOS's tmp reaper cleans /tmp
on its own schedule, so per-iteration archives don't accumulate harmfully.
`log collect` succeeds on the first try every time since the path never
pre-exists. No sudo rm needed.
Validated by a 4-side M365 campaign overnight: 11 cold-startup events per
side across all 4 configs, zero hangs, with the orchestrator running fully
detached from any user TTY.1 parent 8a3b644 commit a64580b
1 file changed
Lines changed: 15 additions & 10 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
611 | 611 | | |
612 | 612 | | |
613 | 613 | | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
621 | 624 | | |
622 | 625 | | |
623 | 626 | | |
624 | 627 | | |
625 | 628 | | |
626 | | - | |
| 629 | + | |
627 | 630 | | |
628 | 631 | | |
629 | 632 | | |
| |||
673 | 676 | | |
674 | 677 | | |
675 | 678 | | |
676 | | - | |
677 | | - | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
678 | 683 | | |
679 | 684 | | |
680 | 685 | | |
| |||
0 commit comments