package linux
import "github.com/containerd/containerd/linux"
Index ¶
- func New(ic *plugin.InitContext) (interface{}, error)
- type Config
- type Process
- func (p *Process) CloseIO(ctx context.Context) error
- func (p *Process) ID() string
- func (p *Process) Kill(ctx context.Context, signal uint32, _ bool) error
- func (p *Process) ResizePty(ctx context.Context, size runtime.ConsoleSize) error
- func (p *Process) Start(ctx context.Context) error
- func (p *Process) State(ctx context.Context) (runtime.State, error)
- func (p *Process) Wait(ctx context.Context) (*runtime.Exit, error)
- type Runtime
- func (r *Runtime) Create(ctx context.Context, id string, opts runtime.CreateOpts) (_ runtime.Task, err error)
- func (r *Runtime) Delete(ctx context.Context, c runtime.Task) (*runtime.Exit, error)
- func (r *Runtime) Get(ctx context.Context, id string) (runtime.Task, error)
- func (r *Runtime) ID() string
- func (r *Runtime) Tasks(ctx context.Context) ([]runtime.Task, error)
- type ShimOpt
- func ShimConnect() ShimOpt
- func ShimLocal(exchange *exchange.Exchange) ShimOpt
- func ShimRemote(shimBinary, daemonAddress, cgroup string, nonewns, debug bool, exitHandler func()) ShimOpt
- type Task
- func (t *Task) Cgroup() (cgroups.Cgroup, error)
- func (t *Task) Checkpoint(ctx context.Context, path string, options *types.Any) error
- func (t *Task) CloseIO(ctx context.Context) error
- func (t *Task) DeleteProcess(ctx context.Context, id string) (*runtime.Exit, error)
- func (t *Task) Exec(ctx context.Context, id string, opts runtime.ExecOpts) (runtime.Process, error)
- func (t *Task) ID() string
- func (t *Task) Info() runtime.TaskInfo
- func (t *Task) Kill(ctx context.Context, signal uint32, all bool) error
- func (t *Task) Metrics(ctx context.Context) (interface{}, error)
- func (t *Task) Pause(ctx context.Context) error
- func (t *Task) Pids(ctx context.Context) ([]runtime.ProcessInfo, error)
- func (t *Task) Process(ctx context.Context, id string) (runtime.Process, error)
- func (t *Task) ResizePty(ctx context.Context, size runtime.ConsoleSize) error
- func (t *Task) Resume(ctx context.Context) error
- func (t *Task) Start(ctx context.Context) error
- func (t *Task) State(ctx context.Context) (runtime.State, error)
- func (t *Task) Update(ctx context.Context, resources *types.Any) error
- func (t *Task) Wait(ctx context.Context) (*runtime.Exit, error)
Functions ¶
func New ¶
func New(ic *plugin.InitContext) (interface{}, error)
New returns a configured runtime
Types ¶
type Config ¶
type Config struct { // Shim is a path or name of binary implementing the Shim GRPC API Shim string `toml:"shim"` // Runtime is a path or name of an OCI runtime used by the shim Runtime string `toml:"runtime"` // RuntimeRoot is the path that shall be used by the OCI runtime for its data RuntimeRoot string `toml:"runtime_root"` // NoShim calls runc directly from within the pkg NoShim bool `toml:"no_shim"` // Debug enable debug on the shim ShimDebug bool `toml:"shim_debug"` // ShimNoMountNS prevents the runtime from putting shims into their own mount namespace. // // Putting the shim in its own mount namespace ensure that any mounts made // by it in order to get the task rootfs ready will be undone regardless // on how the shim dies. // // NOTE: This should only be used in kernel older than 3.18 to avoid shims // from causing a DoS in their parent namespace due to having a copy of // mounts previously there which would prevent unlink, rename and remove // operations on those mountpoints. ShimNoMountNS bool `toml:"shim_no_newns"` }
Config options for the runtime
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
Process implements a linux process
func (*Process) CloseIO ¶
CloseIO closes the provided IO pipe for the process
func (*Process) ID ¶
ID of the process
func (*Process) Kill ¶
Kill sends the provided signal to the underlying process
Unable to kill all processes in the task using this method on a process
func (*Process) ResizePty ¶
ResizePty changes the side of the process's PTY to the provided width and height
func (*Process) Start ¶
Start the process
func (*Process) State ¶
State of process
func (*Process) Wait ¶
Wait on the process to exit and return the exit status and timestamp
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime for a linux based system
func (*Runtime) Create ¶
func (r *Runtime) Create(ctx context.Context, id string, opts runtime.CreateOpts) (_ runtime.Task, err error)
Create a new task
func (*Runtime) Delete ¶
Delete a task removing all on disk state
func (*Runtime) Get ¶
Get a specific task by task id
func (*Runtime) ID ¶
ID of the runtime
func (*Runtime) Tasks ¶
Tasks returns all tasks known to the runtime
type ShimOpt ¶
ShimOpt specifies shim options for initialization and connection
func ShimConnect ¶
func ShimConnect() ShimOpt
ShimConnect is a ShimOpt for connecting to an existing remote shim
func ShimLocal ¶
ShimLocal is a ShimOpt for using an in process shim implementation
func ShimRemote ¶
func ShimRemote(shimBinary, daemonAddress, cgroup string, nonewns, debug bool, exitHandler func()) ShimOpt
ShimRemote is a ShimOpt for connecting and starting a remote shim
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
Task on a linux based system
func (*Task) Cgroup ¶
Cgroup returns the underlying cgroup for a linux task
func (*Task) Checkpoint ¶
Checkpoint creates a system level dump of the task and process information that can be later restored
func (*Task) CloseIO ¶
CloseIO closes the provided IO on the task
func (*Task) DeleteProcess ¶
DeleteProcess removes the provided process from the task and deletes all on disk state
func (*Task) Exec ¶
Exec creates a new process inside the task
func (*Task) ID ¶
ID of the task
func (*Task) Info ¶
Info returns task information about the runtime and namespace
func (*Task) Kill ¶
Kill the task using the provided signal
Optionally send the signal to all processes that are a child of the task
func (*Task) Metrics ¶
Metrics returns runtime specific system level metric information for the task
func (*Task) Pause ¶
Pause the task and all processes
func (*Task) Pids ¶
Pids returns all system level process ids running inside the task
func (*Task) Process ¶
Process returns a specific process inside the task by the process id
func (*Task) ResizePty ¶
ResizePty changes the side of the task's PTY to the provided width and height
func (*Task) Resume ¶
Resume the task and all processes
func (*Task) Start ¶
Start the task
func (*Task) State ¶
State returns runtime information for the task
func (*Task) Update ¶
Update changes runtime information of a running task
func (*Task) Wait ¶
Wait for the task to exit returning the status and timestamp
Source Files ¶
bundle.go process.go runtime.go task.go
Directories ¶
Path | Synopsis |
---|---|
linux/proc | |
linux/runctypes | Package runctypes is a generated protocol buffer package. |
linux/shim | |
linux/shim/client | |
linux/shim/v1 | Package shim is a generated protocol buffer package. |
- Version
- v1.0.0-rc.0
- Published
- Dec 1, 2017
- Platform
- linux/amd64
- Imports
- 39 packages
- Last checked
- 1 minute ago –
Tools for package owners.