proc

package
v0.0.0-...-194cf1f Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: Apache-2.0 Imports: 10 Imported by: 5

Documentation

Overview

Package process wraps up the os.Process interface and also provides os-specific process lookup functions

Package process wraps up the os.Process interface and also provides os-specific process lookup functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeWorkerDependencies

func InitializeWorkerDependencies(log log.T, args []string) (*appconfig.SsmagentConfig, identity.IAgentIdentity, string, error)

Types

type OSProcess

type OSProcess interface {
	//generic ssm visible fields
	Pid() int
	StartTime() time.Time
	//kill the attached child process
	Kill() error
	//wait for the child to finish, if parent dies halfway, the child process is detached and becomes orphan
	//On Unix system, orphan is not be killed by systemd or upstart by default
	//On Windows service controller, stop service does not kill orphan by default
	//TODO confirm MSI Installer does not kill the child process
	Wait() error
}

OSProcess is an abstracted interface of os.Process

func StartProcess

func StartProcess(name string, argv []string) (OSProcess, error)

start a child process, with the resources attached to its parent

type WorkerProcess

type WorkerProcess struct {
	*exec.Cmd
	// contains filtered or unexported fields
}

impl of OSProcess with os.Process embed

func (*WorkerProcess) Kill

func (p *WorkerProcess) Kill() error

TODO use the kill functions provided in executes package

func (*WorkerProcess) Pid

func (p *WorkerProcess) Pid() int

func (*WorkerProcess) StartTime

func (p *WorkerProcess) StartTime() time.Time

func (*WorkerProcess) Wait

func (p *WorkerProcess) Wait() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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