systemd

package
v0.0.0-...-4bd6544 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2016 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const CleanShutdownService = `` /* 236-byte string literal not displayed */

CleanShutdownService is added to machines to ensure DHCP-assigned IP addresses are released on shutdown, reboot, or halt. See bug http://pad.lv/1348663 for more info.

View Source
const CleanShutdownServicePath = "/etc/systemd/system/juju-clean-shutdown.service"

CleanShutdownServicePath is the full file path where CleanShutdownService is created.

Variables

This section is empty.

Functions

func IsRunning

func IsRunning() (bool, error)

IsRunning returns whether or not systemd is the local init system.

func ListCommand

func ListCommand() string

ListCommand returns a command that will list the services on a host.

func ListServices

func ListServices() ([]string, error)

ListServices returns the list of installed service names.

func UnitSerialize

func UnitSerialize(opts []*unit.UnitOption) io.Reader

UnitSerialize encodes all of the given UnitOption objects into a unit file. Renamed from Serialize from github.com/coreos/go-systemd/unit so as to not confict with the exported internal function in export_test.go.

Types

type Cmdline

type Cmdline struct {
	// contains filtered or unexported fields
}

Cmdline exposes the core operations of interacting with systemd units.

func (Cmdline) ListAll

func (cl Cmdline) ListAll() ([]string, error)

ListAll returns the names of all enabled systemd units.

type Service

type Service struct {
	common.Service

	ConfName string
	UnitName string
	Dirname  string
	Script   []byte
}

Service provides visibility into and control over a systemd service.

func NewService

func NewService(name string, conf common.Conf, dataDir string) (*Service, error)

NewService returns a new value that implements Service for systemd.

func (Service) Conf

func (s Service) Conf() common.Conf

Conf implements service.Service.

func (*Service) Exists

func (s *Service) Exists() (bool, error)

Exists implements Service.

func (*Service) Install

func (s *Service) Install() error

Install implements Service.

func (*Service) InstallCommands

func (s *Service) InstallCommands() ([]string, error)

InstallCommands implements Service.

func (*Service) Installed

func (s *Service) Installed() (bool, error)

Installed implements Service.

func (Service) Name

func (s Service) Name() string

Name implements service.Service.

func (*Service) Remove

func (s *Service) Remove() error

Remove implements Service.

func (*Service) Running

func (s *Service) Running() (bool, error)

Running implements Service.

func (*Service) Start

func (s *Service) Start() error

Start implements Service.

func (*Service) StartCommands

func (s *Service) StartCommands() ([]string, error)

StartCommands implements Service.

func (*Service) Stop

func (s *Service) Stop() error

Stop implements Service.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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