juju: github.com/juju/juju/service/upstart Index | Files

package upstart

import "github.com/juju/juju/service/upstart"

Index

Package Files

upstart.go

Constants

const CleanShutdownJob = "" /* 177 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.

const CleanShutdownJobPath = "/etc/init/juju-clean-shutdown.conf"

CleanShutdownJobPath is the full file path where CleanShutdownJob is created.

Variables

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

)

func IsRunning Uses

func IsRunning() (bool, error)

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

func ListCommand Uses

func ListCommand() string

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

func ListServices Uses

func ListServices() ([]string, error)

ListServices returns the name of all installed services on the local host.

func Serialize Uses

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

Serialize renders the conf as raw bytes.

type Service Uses

type Service struct {
    common.Service
}

Service provides visibility into and control over an upstart service.

func NewService Uses

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

func (Service) Conf Uses

func (s Service) Conf() common.Conf

Conf implements service.Service.

func (*Service) Exists Uses

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 Uses

func (s *Service) Install() error

Install installs and starts the service.

func (*Service) InstallCommands Uses

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

InstallCommands returns shell commands to install the service.

func (*Service) Installed Uses

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

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

func (Service) Name Uses

func (s Service) Name() string

Name implements service.Service.

func (*Service) Remove Uses

func (s *Service) Remove() error

Remove deletes the service configuration from the init directory.

func (*Service) Restart Uses

func (s *Service) Restart() error

Restart restarts the service.

func (*Service) Running Uses

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

Running returns true if the Service appears to be running.

func (*Service) Start Uses

func (s *Service) Start() error

Start starts the service.

func (*Service) StartCommands Uses

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

StartCommands returns shell commands to start the service.

func (*Service) Stop Uses

func (s *Service) Stop() error

Stop stops the service.

func (*Service) Validate Uses

func (s *Service) Validate() error

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

Package upstart imports 13 packages (graph) and is imported by 85 packages. Updated 2019-04-04. Refresh now. Tools for package owners.