systemd

package
v0.0.0-...-1f9b3f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package systemd provides systemd related actions.

Index

Constants

This section is empty.

Variables

View Source
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

func IsJobDependency(err error) bool

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL