proc

package
v1.2.14 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const InitPidFile = "init.pid"

InitPidFile name of the file that contains the init pid

View Source
const (
	RuncRoot = "/run/containerd/runc"
)

RuncRoot is the path to the root runc state directory

Variables

This section is empty.

Functions

func NewRunc

func NewRunc(root, path, namespace, runtime, criu string, systemd bool) *runc.Runc

NewRunc returns a new runc instance for a process

Types

type CheckpointConfig

type CheckpointConfig struct {
	Path                     string
	Exit                     bool
	AllowOpenTCP             bool
	AllowExternalUnixSockets bool
	AllowTerminal            bool
	FileLocks                bool
	EmptyNamespaces          []string
}

CheckpointConfig holds task checkpoint configuration

type CreateConfig

type CreateConfig struct {
	ID               string
	Bundle           string
	Runtime          string
	Rootfs           []Mount
	Terminal         bool
	Stdin            string
	Stdout           string
	Stderr           string
	Checkpoint       string
	ParentCheckpoint string
	Options          *google_protobuf.Any
}

CreateConfig hold task creation configuration

type ExecConfig

type ExecConfig struct {
	ID       string
	Terminal bool
	Stdin    string
	Stdout   string
	Stderr   string
	Spec     *google_protobuf.Any
}

ExecConfig holds exec creation configuration

type Init

type Init struct {
	WorkDir string

	Bundle string

	Platform proc.Platform

	Rootfs       string
	IoUID        int
	IoGID        int
	NoPivotRoot  bool
	NoNewKeyring bool
	// contains filtered or unexported fields
}

Init represents an initial process for a container

func New

func New(id string, runtime *runc.Runc, stdio proc.Stdio) *Init

New returns a new process

func (*Init) Checkpoint added in v1.2.1

func (p *Init) Checkpoint(ctx context.Context, r *CheckpointConfig) error

Checkpoint the init process

func (*Init) Create

func (p *Init) Create(ctx context.Context, r *CreateConfig) error

Create the process with the provided config

func (*Init) Delete added in v1.2.1

func (p *Init) Delete(ctx context.Context) error

Delete the init process

func (*Init) Exec added in v1.2.1

func (p *Init) Exec(ctx context.Context, path string, r *ExecConfig) (proc.Process, error)

Exec returns a new child process

func (*Init) ExitStatus

func (p *Init) ExitStatus() int

ExitStatus of the process

func (*Init) ExitedAt

func (p *Init) ExitedAt() time.Time

ExitedAt at time when the process exited

func (*Init) ID

func (p *Init) ID() string

ID of the process

func (*Init) Kill added in v1.2.1

func (p *Init) Kill(ctx context.Context, signal uint32, all bool) error

Kill the init process

func (*Init) KillAll

func (p *Init) KillAll(ctx context.Context) error

KillAll processes belonging to the init process

func (*Init) Pause added in v1.2.1

func (p *Init) Pause(ctx context.Context) error

Pause the init process and all its child processes

func (*Init) Pid

func (p *Init) Pid() int

Pid of the process

func (*Init) Resize added in v1.2.1

func (p *Init) Resize(ws console.WinSize) error

Resize the init processes console

func (*Init) Resume added in v1.2.1

func (p *Init) Resume(ctx context.Context) error

Resume the init process and all its child processes

func (*Init) Runtime

func (p *Init) Runtime() *runc.Runc

Runtime returns the OCI runtime configured for the init process

func (*Init) SetExited added in v1.2.1

func (p *Init) SetExited(status int)

SetExited of the init process with the next status

func (*Init) Start added in v1.2.1

func (p *Init) Start(ctx context.Context) error

Start the init process

func (*Init) Status

func (p *Init) Status(ctx context.Context) (string, error)

Status of the process

func (*Init) Stdin

func (p *Init) Stdin() io.Closer

Stdin of the process

func (*Init) Stdio

func (p *Init) Stdio() proc.Stdio

Stdio of the process

func (*Init) Update added in v1.2.1

func (p *Init) Update(ctx context.Context, r *google_protobuf.Any) error

Update the processes resource configuration

func (*Init) Wait

func (p *Init) Wait()

Wait for the process to exit

type Mount

type Mount struct {
	Type    string
	Source  string
	Target  string
	Options []string
}

Mount holds filesystem mount configuration

Jump to

Keyboard shortcuts

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