Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var JournalctlCmd = jctl
JournalctlCmd is called from Logs to run journalctl; exported for testing.
View Source
var SystemctlCmd = run
SystemctlCmd is called from the commands to actually call out to systemctl. It's exported so it can be overridden by testing.
Functions ¶
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is returned if the systemd action failed
type Log ¶
type Log map[string]interface{}
A Log is a single entry in the systemd journal
func (Log) RawTimestamp ¶
RawTimestamp of the log: microseconds since epoch UTC, as a decimal string, or "-" if missing.
type ServiceDescription ¶
type ServiceDescription struct { AppName string ServiceName string Version string Description string AppPath string Start string Stop string PostStop string StopTimeout time.Duration AaProfile string IsFramework bool IsNetworked bool BusName string UdevAppName string Forking bool Socket bool SocketFileName string ListenStream string SocketMode string SocketUser string SocketGroup string ServiceFileName string }
ServiceDescription describes a snappy systemd service
type ServiceStatus ¶
type ServiceStatus struct { ServiceFileName string `json:"service_file_name"` LoadState string `json:"load_state"` ActiveState string `json:"active_state"` SubState string `json:"sub_state"` UnitFileState string `json:"unit_file_state"` }
A ServiceStatus holds structured service status information.
type Systemd ¶
type Systemd interface { DaemonReload() error Enable(service string) error Disable(service string) error Start(service string) error Stop(service string, timeout time.Duration) error Kill(service, signal string) error Restart(service string, timeout time.Duration) error GenServiceFile(desc *ServiceDescription) string GenSocketFile(desc *ServiceDescription) string Status(service string) (string, error) ServiceStatus(service string) (*ServiceStatus, error) Logs(services []string) ([]Log, error) }
Systemd exposes a minimal interface to manage systemd via the systemctl command.
Click to show internal directories.
Click to hide internal directories.