Documentation
¶
Overview ¶
Package daemon implements the long-lived Masterblaster daemon service. The daemon manages VM sandbox lifecycles via a Backend, exposes a JSON-RPC API over a unix domain socket (~/.mb/mb.sock), and handles PID file management and liveness probes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRunning ¶
IsRunning checks if the daemon is running by attempting to connect to the socket and sending a ping.
func PIDFilePath ¶
PIDFilePath returns the path to the daemon's PID file.
func SocketPath ¶
SocketPath returns the path to the daemon's unix socket.
Types ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon is the long-lived Masterblaster service that manages sandbox VMs. It acts as a multiplexer: each VM gets its own vmhost child process that holds the hypervisor handle and control socket. The daemon spawns vmhost processes, monitors their health, and routes CLI requests to them.
type Request ¶
type Request struct {
Method RPCMethod `json:"method"`
// Up parameters
Name string `json:"name,omitempty"`
ConfigPath string `json:"config_path,omitempty"`
// Down/Destroy parameters
Force bool `json:"force,omitempty"`
// Status parameters
All bool `json:"all,omitempty"`
}
Request is the wire format for CLI -> daemon RPC calls.
type Response ¶
type Response struct {
OK bool `json:"ok"`
Error string `json:"error,omitempty"`
// For status/list responses
Sandboxes []SandboxInfo `json:"sandboxes,omitempty"`
}
Response is the wire format for daemon -> CLI responses.
type SandboxInfo ¶
type SandboxInfo struct {
Name string `json:"name"`
State string `json:"state"`
Mixtape string `json:"mixtape"`
CPUs int `json:"cpus"`
Memory string `json:"memory"`
SSHPort int `json:"ssh_port"`
SSHAddress string `json:"ssh_address"`
SSHKeyPath string `json:"ssh_key_path,omitempty"`
VsockPort int `json:"vsock_port"`
NetworkMode string `json:"network_mode"`
}
SandboxInfo is the public representation of a sandbox for CLI display.