Version: v0.0.0-...-4f11ef6 Latest Latest

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

Go to latest
Published: Sep 24, 2021 License: AGPL-3.0 Imports: 13 Imported by: 12




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 for more info.

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

CleanShutdownJobPath is the full file path where CleanShutdownJob is created.


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



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.


type Service

type Service struct {

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.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL