launchd

package
v1.0.5-7-windows Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2015 License: BSD-3-Clause, BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Install

func Install(plist Plist, writer io.Writer) (err error)

Install will install a service

func PlistDestination

func PlistDestination(label string) string

func Restart

func Restart(label string, writer io.Writer) error

Restart restarts a service

func ShowServices

func ShowServices(filters []string, name string, out io.Writer) (err error)

ShowServices outputs keybase service info.

func ShowStatus

func ShowStatus(label string, writer io.Writer) error

ShowStatus shows status info for a service

func Start

func Start(label string, writer io.Writer) error

Start will start a keybase service

func Stop

func Stop(label string, writer io.Writer) error

Stop will stop a keybase service

func Uninstall

func Uninstall(label string, writer io.Writer) error

Uninstall will uninstall a keybase service

Types

type Plist

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

Plist defines a launchd plist

func NewPlist

func NewPlist(label string, binPath string, args []string, envVars map[string]string) Plist

NewPlist constructs a launchd service.

type Service

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

Service defines a service

func ListServices

func ListServices(filters []string) ([]Service, error)

ListServices will return service with label that starts with a filter string.

func NewService

func NewService(label string) Service

NewService constructs a launchd service.

func (Service) Install

func (s Service) Install(p Plist) (err error)

Install will install the launchd service

func (Service) Label

func (s Service) Label() string

Label for service

func (Service) Load

func (s Service) Load(restart bool) error

Load will load the service. If restart=true, then we'll unload it first.

func (Service) LoadStatus

func (s Service) LoadStatus() (*ServiceStatus, error)

Status returns service status

func (*Service) SetWriter

func (s *Service) SetWriter(writer io.Writer)

func (Service) StatusDescription

func (s Service) StatusDescription() string

StatusDescription returns the service status description

func (Service) Uninstall

func (s Service) Uninstall() (err error)

Uninstall will uninstall the launchd service

func (Service) Unload

func (s Service) Unload() error

Unload will unload the service

type ServiceStatus

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

ServiceStatus defines status for a service

func (ServiceStatus) Description

func (s ServiceStatus) Description() string

Description returns service status info

func (ServiceStatus) IsRunning

func (s ServiceStatus) IsRunning() bool

IsRunning is true if the service is running (with a pid)

func (ServiceStatus) Label

func (s ServiceStatus) Label() string

Label for status

func (ServiceStatus) LastExitStatus

func (s ServiceStatus) LastExitStatus() string

LastExitStatus will be blank if pid > 0, or a number "123"

func (ServiceStatus) Pid

func (s ServiceStatus) Pid() string

Pid for status (empty string if not running)

Jump to

Keyboard shortcuts

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