lxd: github.com/lxc/lxd/shared/subprocess Index | Files

package subprocess

import "github.com/lxc/lxd/shared/subprocess"

Index

Package Files

errors.go manager.go proc.go

Variables

var ErrNotRunning = fmt.Errorf("The process isn't running")

ErrNotRunning is returned when performing an action against a stopped process.

type Process Uses

type Process struct {
    Name   string   `yaml:"name"`
    Args   []string `yaml:"args,flow"`
    Pid    int64    `yaml:"pid"`
    Stdout string   `yaml:"stdout"`
    Stderr string   `yaml:"stderr"`
    // contains filtered or unexported fields
}

Process struct. Has ability to set runtime arguments

func ImportProcess Uses

func ImportProcess(path string) (*Process, error)

ImportProcess imports a saved process into a subprocess object.

func NewProcess Uses

func NewProcess(name string, args []string, stdoutPath string, stderrPath string) (*Process, error)

NewProcess is a constructor for a process object. Represents a process with argument config. Returns an address to process

func (*Process) GetPid Uses

func (p *Process) GetPid() (int64, error)

GetPid returns the pid for the given process object

func (*Process) Reload Uses

func (p *Process) Reload() error

Reload sends the SIGHUP signal to the given process object

func (*Process) Restart Uses

func (p *Process) Restart() error

Restart stop and starts the given process object

func (*Process) Save Uses

func (p *Process) Save(path string) error

Save will save the given process object to a YAML file. Can be imported at a later point.

func (*Process) Signal Uses

func (p *Process) Signal(signal int64) error

Signal will send a signal to the given process object given a signal value

func (*Process) Start Uses

func (p *Process) Start() error

Start will start the given process object

func (*Process) Stop Uses

func (p *Process) Stop() error

Stop will stop the given process object

func (*Process) Wait Uses

func (p *Process) Wait() (int64, error)

Wait will wait for the given process object exit code

Package subprocess imports 8 packages (graph) and is imported by 6 packages. Updated 2020-02-20. Refresh now. Tools for package owners.