Documentation
¶
Overview ¶
Package service registers vmflow as a native OS service so it starts at boot and restarts on crash:
- Linux: systemd unit (/etc/systemd/system/<name>.service)
- macOS: launchd daemon (/Library/LaunchDaemons/io.cloudapp.<name>.plist)
- Windows: Windows Service (managed via services.msc / SCM APIs)
The package only performs install/uninstall/status: it generates the unit or plist file and invokes the platform's service manager (systemctl / launchctl / Windows SCM). The runtime itself does not need this package to run: Linux and macOS execute vmflow in the foreground and supervise it via signals; on Windows vmflow detects the SCM at startup (see cmd/vmflow/daemon_windows.go) and reports state itself.
Style follows internal/updater: error-return (no logger in the package), progress streamed to an io.Writer, and file writes use a same-directory temp + rename for atomicity.
Index ¶
Constants ¶
const DefaultServiceName = "vmflow"
DefaultServiceName is the service/unit/registry name used when Config.Name is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// BinaryPath is the vmflow executable path. Defaults to the current
// executable when empty.
BinaryPath string
// ConfigPath is the -config path the service runs with. Defaults to the
// platform's system config path when empty.
ConfigPath string
// ServiceName is the service/unit/registry name. Defaults to "vmflow".
ServiceName string
// User is the systemd User= the unit runs as (Linux only). Empty = root.
// When set and the account is missing, install creates it as a system user.
User string
// LogFile redirects daemon logs. On Linux/Windows it is passed to the daemon
// via -log-file; on macOS it sets the launchd capture paths. Windows defaults
// to a durable path under ProgramData because the SCM provides no stdout.
LogFile string
// ControlPort overrides the daemon's loopback-only management port. Zero
// keeps the value from the config file.
ControlPort int
// ExtraArgs are individual extra arguments appended to the daemon command
// line for future daemon flags. Existing daemon flags have dedicated Config
// fields and are rejected here to prevent overriding validated paths.
ExtraArgs []string
}
Config describes how to install or query the vmflow service.