Move the supported systemd path to two services: an owner-user bangerd for orchestration and a narrow root helper for bridge/tap, NAT/resolver, dm/loop, and Firecracker ownership. This removes repeated sudo from daily vm and image flows without leaving the general daemon running as root. Add install metadata, system install/status/restart/uninstall commands, and a system-owned runtime layout. Keep user SSH/config material in the owner home, lock file_sync to the owner home, and move daemon known_hosts handling out of the old root-owned control path. Route privileged lifecycle steps through typed privilegedOps calls, harden the two systemd units, and rewrite smoke plus docs around the supported service model. Verified with make build, make test, make lint, and make smoke on the supported systemd host path.
23 lines
733 B
Go
23 lines
733 B
Go
package daemon
|
|
|
|
import (
|
|
"context"
|
|
|
|
"banger/internal/daemon/dmsnap"
|
|
)
|
|
|
|
// dmSnapshotHandles is retained as a package-local alias for the subpackage
|
|
// type so existing call sites and tests read naturally.
|
|
type dmSnapshotHandles = dmsnap.Handles
|
|
|
|
func (n *HostNetwork) createDMSnapshot(ctx context.Context, rootfsPath, cowPath, dmName string) (dmSnapshotHandles, error) {
|
|
return n.privOps().CreateDMSnapshot(ctx, rootfsPath, cowPath, dmName)
|
|
}
|
|
|
|
func (n *HostNetwork) cleanupDMSnapshot(ctx context.Context, handles dmSnapshotHandles) error {
|
|
return n.privOps().CleanupDMSnapshot(ctx, handles)
|
|
}
|
|
|
|
func (n *HostNetwork) removeDMSnapshot(ctx context.Context, target string) error {
|
|
return n.privOps().RemoveDMSnapshot(ctx, target)
|
|
}
|