Commit f728537
Roy Lin
fix(box): a non---rm box survives stop (keeps dir+logs) like Docker
A foreground `run` without `--rm` wiped its entire box dir (logs included) on
exit via destroy_with_options (non-persistent boxes are removed), while keeping
the state record — so the box showed in `ps -a` but `logs`/`start` found
nothing. Docker keeps a stopped container (and its logs) until `rm`.
Make a box persistent unless `--rm`: `persistent = --persistent || !--rm`.
Persistent only affects teardown cleanup (keep the box dir + overlay upper, the
overlay is unmounted either way — no mount leak); it has no boot-time effect.
`--rm` boxes and CRI pods stay non-persistent (removed on teardown, no pod-dir
leak), and `rm` force-removes regardless (cleanup_removed_box).
KVM-verified: `run` (no --rm) -> `logs` shows the output after exit and the box
is in `ps -a`; `run --rm` -> 0 boxes after; `rm` -> removed; detached logs
still complete. Completes the `run`+`logs` workflow alongside the shim-owned
log processor.1 parent 8794cb5 commit f728537
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
476 | | - | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
477 | 481 | | |
478 | 482 | | |
479 | 483 | | |
| |||
0 commit comments