Documentation ¶
Overview ¶
Package systemd provides systemd related actions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( JobCanceledError = errgo.New("job has been canceled before it finished execution") JobTimeoutError = errgo.New("job timeout was reached") JobFailedError = errgo.New("job failed") JobSkippedError = errgo.New("job was skipped because it didn't apply to the units current state") JobDependencyError = errgo.New("job failed because of failed dependency") JobExecutionTookTooLongError = errgo.New("job execution took too long") UnknownSystemdResponseError = errgo.New("received unknown systemd response") )
Errors related to systemd.
Functions ¶
func Configure ¶
func Configure(vl func(f string, v ...interface{}))
Configure sets the logger for this package.
func IsJobDependency ¶
IsJobDependency returns true if the given err is a JobDependencyError.
Types ¶
type SystemdClient ¶
type SystemdClient struct{}
SystemdClient is a client for managing systemd.
func NewSystemdClient ¶
func NewSystemdClient() (*SystemdClient, error)
NewSystemdClient returns a new SystemdClient.
func (*SystemdClient) Exists ¶
func (sdc *SystemdClient) Exists(unit string) (bool, error)
Exists checks if a unit exists in systemd.
func (*SystemdClient) Reload ¶
func (sdc *SystemdClient) Reload() error
Reload instructs systemd to scan for and reload unit files. Equivalent to a 'systemctl daemon-reload'. See https://godoc.org/github.com/coreos/go-systemd/dbus#Conn.Reload.
func (*SystemdClient) Start ¶
func (sdc *SystemdClient) Start(unit string) error
Start instructs systemd to start a job. See http://godoc.org/github.com/coreos/go-systemd/dbus#Conn.StartUnit.
func (*SystemdClient) Stop ¶
func (sdc *SystemdClient) Stop(unit string) error
Stop instructs systemd to stop a job. See https://godoc.org/github.com/coreos/go-systemd/dbus#Conn.StopUnit.