banger/internal/cli
Thales Maciel 1be90a7af5
Preserve runtime dir across restart so reconcile re-finds VMs
v0.1.4 fixed the binary-level reconcile path for jailer'd VMs but
left a hole at the systemd layer: bangerd.service and bangerd-root.service
both defaulted to RuntimeDirectoryPreserve=no, so /run/banger was
wiped on every daemon stop. The api-sock symlinks the helper creates
for live VMs (`/run/banger/fc-<id>.sock` → `<chroot>/firecracker.socket`)
went with it, and findByJailerPidfile — which derives the chroot
from the symlink target — couldn't resolve them. Reconcile then fell
through to "stale_vm" and tore down the surviving FC's dm-snapshot.

Add RuntimeDirectoryPreserve=yes to both unit templates so the
symlinks survive the restart window. Live-verified end-to-end on
the dev host: started a VM under v0.1.5, restarted helper +
daemon, confirmed the FC PID was unchanged and `banger vm ssh`
returned the same boot_id pre and post.

Daemon-lifecycle tests updated to assert the new directive is
present in both rendered units so future regressions show up at
test time.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 17:17:25 -03:00
..
style cli: maturity polish — color, error translation, tabwriter consistency 2026-04-26 22:27:07 -03:00
aliases_test.go remove vm session feature 2026-04-20 12:47:58 -03:00
banger.go cli: add banger update command 2026-04-29 12:35:04 -03:00
bangerd.go update: docs + publish script for the self-update feature 2026-04-29 12:43:46 -03:00
cli_test.go cli: add banger update command 2026-04-29 12:35:04 -03:00
commands_daemon.go daemon: split owner daemon from root helper 2026-04-26 12:43:17 -03:00
commands_image.go Merge model,cli,docs polish for v0.1.0 2026-04-28 17:36:47 -03:00
commands_internal.go cli + daemon: move test seams off package globals onto injected structs 2026-04-19 19:03:55 -03:00
commands_kernel.go cli,docs: trivial polish for v0.1.0 2026-04-28 17:31:54 -03:00
commands_ssh_config.go cli: rewrite help text for AI-driven discovery 2026-04-26 15:02:08 -03:00
commands_system.go Preserve runtime dir across restart so reconcile re-finds VMs 2026-04-29 17:17:25 -03:00
commands_update.go update: refresh install.toml commit + built_at from new binary 2026-04-29 14:38:59 -03:00
commands_update_test.go update: refresh install.toml commit + built_at from new binary 2026-04-29 14:38:59 -03:00
commands_vm.go Merge model,cli,docs polish for v0.1.0 2026-04-28 17:36:47 -03:00
completion.go cli,docs: trivial polish for v0.1.0 2026-04-28 17:31:54 -03:00
completion_test.go remove vm session feature 2026-04-20 12:47:58 -03:00
daemon_lifecycle.go cli: wait for the daemon socket to answer ping after install/restart 2026-04-26 21:22:31 -03:00
daemon_lifecycle_test.go Preserve runtime dir across restart so reconcile re-finds VMs 2026-04-29 17:17:25 -03:00
deps.go seams: move the last four package globals onto instance fields 2026-04-22 12:07:14 -03:00
errors.go cli: maturity polish — color, error translation, tabwriter consistency 2026-04-26 22:27:07 -03:00
errors_test.go cli: maturity polish — color, error translation, tabwriter consistency 2026-04-26 22:27:07 -03:00
formatters_test.go cli,docs: trivial polish for v0.1.0 2026-04-28 17:31:54 -03:00
known_hosts.go daemon: split owner daemon from root helper 2026-04-26 12:43:17 -03:00
make_bundle_test.go banger internal make-bundle: build image bundles from flat rootfs tars 2026-04-17 15:17:50 -03:00
printers.go cli,docs: trivial polish for v0.1.0 2026-04-28 17:31:54 -03:00
prune_test.go cli + daemon: move test seams off package globals onto injected structs 2026-04-19 19:03:55 -03:00
ssh.go smoke: five more scenarios + fix exit-code propagation bug the new ones caught 2026-04-22 19:37:07 -03:00
vm_create.go cli: maturity polish — color, error translation, tabwriter consistency 2026-04-26 22:27:07 -03:00
vm_exec.go feat(vm): add vm exec command with workspace dirty detection 2026-04-26 23:53:45 -03:00
vm_run.go daemon: split owner daemon from root helper 2026-04-26 12:43:17 -03:00
vm_spec_test.go vm defaults: host-aware sizing + spec line on spawn + doctor check 2026-04-19 13:06:51 -03:00
workspace_preview.go noteUntrackedSkipped: fix subdir underreport + be best-effort everywhere 2026-04-22 12:42:33 -03:00
workspace_preview_test.go noteUntrackedSkipped: fix subdir underreport + be best-effort everywhere 2026-04-22 12:42:33 -03:00