control

package
v0.0.0-...-23e6066 Latest Latest
Warning

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

Go to latest
Published: May 3, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package control contains types that expose control server methods, and can be used to configure and interact with a running sandbox process.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintPIDsJSON

func PrintPIDsJSON(pl []*Process) (string, error)

PrintPIDsJSON prints a JSON object containing only the PIDs in pl. This behavior is the same as runc's.

func ProcessListToJSON

func ProcessListToJSON(pl []*Process) (string, error)

ProcessListToJSON will return the JSON representation of ps.

func ProcessListToTable

func ProcessListToTable(pl []*Process) string

ProcessListToTable prints a table with the following format: UID PID PPID C STIME TIME CMD 0 1 0 0 14:04 505262ns tail

func Processes

func Processes(k *kernel.Kernel, out *[]*Process) error

Processes retrieves information about processes running in the sandbox.

Types

type ExecArgs

type ExecArgs struct {
	// Filename is the filename to load.
	//
	// If this is provided as "", then the file will be guessed via Argv[0].
	Filename string `json:"filename"`

	// Argv is a list of arguments.
	Argv []string `json:"argv"`

	// Envv is a list of environment variables.
	Envv []string `json:"envv"`

	// WorkingDirectory defines the working directory for the new process.
	WorkingDirectory string `json:"wd"`

	// KUID is the UID to run with in the root user namespace. Defaults to
	// root if not set explicitly.
	KUID auth.KUID

	// KGID is the GID to run with in the root user namespace. Defaults to
	// the root group if not set explicitly.
	KGID auth.KGID

	// ExtraKGIDs is the list of additional groups to which the user
	// belongs.
	ExtraKGIDs []auth.KGID

	// Capabilities is the list of capabilities to give to the process.
	Capabilities *auth.TaskCapabilities

	// FilePayload determines the files to give to the new process.
	urpc.FilePayload
}

ExecArgs is the set of arguments to exec.

type Proc

type Proc struct {
	Kernel *kernel.Kernel
}

Proc includes task-related functions.

At the moment, this is limited to exec support.

func (*Proc) Exec

func (proc *Proc) Exec(args *ExecArgs, waitStatus *uint32) error

Exec runs a new task.

func (*Proc) Ps

func (proc *Proc) Ps(args *PsArgs, out *string) error

Ps provides a process listing for the running kernel.

type Process

type Process struct {
	UID auth.KUID       `json:"uid"`
	PID kernel.ThreadID `json:"pid"`
	// Parent PID
	PPID kernel.ThreadID `json:"ppid"`
	// Processor utilization
	C int32 `json:"c"`
	// Start time
	STime string `json:"stime"`
	// CPU time
	Time string `json:"time"`
	// Executable shortname (e.g. "sh" for /bin/sh)
	Cmd string `json:"cmd"`
}

Process contains information about a single process in a Sandbox. TODO: Implement TTY field.

type PsArgs

type PsArgs struct {
	// JSON will force calls to Ps to return the result as a JSON payload.
	JSON bool
}

PsArgs is the set of arguments to ps.

Jump to

Keyboard shortcuts

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