upstart

package
v0.0.0-...-2608902 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2016 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const CleanShutdownJob = `` /* 175-byte string literal not displayed */

CleanShutdownJob 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 CleanShutdownJobPath = "/etc/init/juju-clean-shutdown.conf"

CleanShutdownJobPath is the full file path where CleanShutdownJob is created.

Variables

View Source
var (
	InitDir = "/etc/init" // the default init directory name.

)

Functions

func IsRunning

func IsRunning() (bool, error)

IsRunning returns whether or not upstart 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 name of all installed services on the local host.

func Serialize

func Serialize(name string, conf common.Conf) ([]byte, error)

Serialize renders the conf as raw bytes.

Types

type Service

type Service struct {
	common.Service
}

Service provides visibility into and control over an upstart service.

func NewService

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

func (Service) Conf

func (s Service) Conf() common.Conf

Conf implements service.Service.

func (*Service) Exists

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

Exists returns whether the service configuration exists in the init directory with the same content that this Service would have if installed.

func (*Service) Install

func (s *Service) Install() error

Install installs and starts the service.

func (*Service) InstallCommands

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

InstallCommands returns shell commands to install the service.

func (*Service) Installed

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

Installed returns whether the service configuration exists in the init directory.

func (Service) Name

func (s Service) Name() string

Name implements service.Service.

func (*Service) Remove

func (s *Service) Remove() error

Remove deletes the service configuration from the init directory.

func (*Service) Restart

func (s *Service) Restart() error

Restart restarts the service.

func (*Service) Running

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

Running returns true if the Service appears to be running.

func (*Service) Start

func (s *Service) Start() error

Start starts the service.

func (*Service) StartCommands

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

StartCommands returns shell commands to start the service.

func (*Service) Stop

func (s *Service) Stop() error

Stop stops the service.

func (*Service) Validate

func (s *Service) Validate() error

Validate returns an error if the service is not adequately defined.

Jump to

Keyboard shortcuts

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