systemd

package
v0.0.0-...-3479ee1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SystemdError = errgo.New("systemd error")
)

Functions

This section is empty.

Types

type SystemdClient

type SystemdClient struct {
	Logger *logging.Logger
}

func NewSystemdClient

func NewSystemdClient(logger *logging.Logger) *SystemdClient

NewSystemdClient creates a new systemd client

func (*SystemdClient) Disable

func (sdc *SystemdClient) Disable(unit string) error

Disable behaves as `systemctl disable <unit>`

func (*SystemdClient) Enable

func (sdc *SystemdClient) Enable(unit string) error

Enable behaves as `systemctl enable <unit>`

func (*SystemdClient) Exists

func (sdc *SystemdClient) Exists(unit string) (bool, error)

Exists returns true if the given unit exists, false otherwise.

func (*SystemdClient) IsActive

func (sdc *SystemdClient) IsActive(unit string) (bool, error)

IsActive returns true if the given unit exists and its ActiveState is 'active', false otherwise.

func (*SystemdClient) Reload

func (sdc *SystemdClient) Reload() error

Reload behaves as `systemctl daemon-reload`

func (*SystemdClient) Restart

func (sdc *SystemdClient) Restart(unit string) error

Restart behaves as `systemctl restart <unit>`

func (*SystemdClient) Start

func (sdc *SystemdClient) Start(unit string) error

Start behaves as `systemctl start <unit>`

func (*SystemdClient) Stop

func (sdc *SystemdClient) Stop(unit string) error

Stop behaves as `systemctl stop <unit>`

func (*SystemdClient) StopAndRemove

func (sdc *SystemdClient) StopAndRemove(unit string, filesToRemove ...string) error

StopAndRemove stops the given unit, disables it, and removes all given files.

Jump to

Keyboard shortcuts

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