Documentation
¶
Overview ¶
Package service implements `dockercmd --install-service` and friends: it installs Docker Commander as a background service for the current OS so the monitor, alert engine and metric history keep running without a browser.
Linux installs the hardened systemd unit (the same one in deploy/, embedded here and kept identical by a test); macOS installs a per-user launchd LaunchAgent; Windows registers a real Service Control Manager (SCM) service (a plain console exe isn't a native service and the SCM gives up on it with error 1053, which is why deploy/install-windows.ps1's Scheduled Task remains available as an alternative that needs no elevation-per-boot subtleties).
The OS-specific Install/Uninstall/Status live in service_{linux,darwin,windows}.go; this file holds the embedded templates and small shared helpers. service_windows.go additionally exposes IsWindowsService/RunWindowsService, the SCM entry point used by cmd/dockercmd when the process is started by the service manager rather than a console; service_notwindows.go stubs those two out everywhere else.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Install ¶
Install sets Docker Commander up as a systemd service: it copies the binary to a stable path, creates a dedicated unprivileged user in the docker group, writes the hardened unit, and enables + starts it. Requires root.
func IsWindowsService ¶ added in v1.6.1
func IsWindowsService() bool
IsWindowsService always reports false outside Windows: there is no Service Control Manager to have started this process.
func RunWindowsService ¶ added in v1.6.1
RunWindowsService only does something on Windows (service_windows.go). This stub exists so cmd/dockercmd can call it unconditionally across platforms; it is never actually invoked here because IsWindowsService() is always false on this OS.
Types ¶
This section is empty.