package proc
import "gvisor.dev/gvisor/pkg/shim/v1/proc"
Package proc is responsible to manage the communication between the shim and the sandbox process running the container.
Index ¶
- Constants
- Variables
- func NewRunsc(root, path, namespace, runtime string, config map[string]string, spec *specs.Spec) *runsccmd.Runsc
- type CreateConfig
- type ExecConfig
- type Exit
- type Init
- func New(id string, runtime *runsccmd.Runsc, stdio stdio.Stdio) *Init
- func (p *Init) Create(ctx context.Context, r *CreateConfig) (err error)
- func (p *Init) Delete(ctx context.Context) error
- func (p *Init) Exec(ctx context.Context, path string, r *ExecConfig) (extension.Process, error)
- func (p *Init) ExitStatus() int
- func (p *Init) ExitedAt() time.Time
- func (p *Init) ID() string
- func (p *Init) Kill(ctx context.Context, signal uint32, all bool) error
- func (p *Init) KillAll(context context.Context)
- func (p *Init) Pid() int
- func (p *Init) Resize(ws console.WinSize) error
- func (p *Init) Restore(ctx context.Context, conf *extension.RestoreConfig) error
- func (p *Init) Runtime() *runsccmd.Runsc
- func (p *Init) SetExited(status int)
- func (p *Init) Start(ctx context.Context) error
- func (p *Init) Stats(ctx context.Context, id string) (*runc.Stats, error)
- func (p *Init) Status(ctx context.Context) (string, error)
- func (p *Init) Stdin() io.Closer
- func (p *Init) Stdio() stdio.Stdio
- func (p *Init) Wait()
- type Mount
- type ProcessMonitor
Constants ¶
const RunscRoot = "/run/containerd/runsc"
RunscRoot is the path to the root runsc state directory.
Variables ¶
ExitCh is the exit events channel for containers and exec processes inside the sandbox.
Functions ¶
func NewRunsc ¶
func NewRunsc(root, path, namespace, runtime string, config map[string]string, spec *specs.Spec) *runsccmd.Runsc
NewRunsc returns a new runsc instance for a process.
Types ¶
type CreateConfig ¶
type CreateConfig struct { ID string Bundle string Runtime string Rootfs []Mount Terminal bool Stdin string Stdout string Stderr string }
CreateConfig hold task creation configuration.
type ExecConfig ¶
type ExecConfig struct { ID string Terminal bool Stdin string Stdout string Stderr string Spec *types.Any }
ExecConfig holds exec creation configuration.
type Exit ¶
Exit is the type of exit events.
type Init ¶
type Init struct { WorkDir string Bundle string Platform stdio.Platform Rootfs string IoUID int IoGID int Sandbox bool UserLog string Monitor ProcessMonitor // contains filtered or unexported fields }
Init represents an initial process for a container.
func New ¶
New returns a new init process.
func (*Init) Create ¶
func (p *Init) Create(ctx context.Context, r *CreateConfig) (err error)
Create the process with the provided config.
func (*Init) Delete ¶
Delete deletes the init process.
func (*Init) Exec ¶
Exec returns a new child process.
func (*Init) ExitStatus ¶
ExitStatus returns the exit status of the process.
func (*Init) ExitedAt ¶
ExitedAt returns the time when the process exited.
func (*Init) ID ¶
ID returns the ID of the process.
func (*Init) Kill ¶
Kill kills the init process.
func (*Init) KillAll ¶
KillAll kills all processes belonging to the init process. If `runsc kill --all` returns error, assume the container has already stopped.
func (*Init) Pid ¶
Pid returns the PID of the process.
func (*Init) Resize ¶
Resize resizes the init processes console.
func (*Init) Restore ¶
Restore restores the container from a snapshot.
func (*Init) Runtime ¶
Runtime returns the OCI runtime configured for the init process.
func (*Init) SetExited ¶
SetExited set the exit status of the init process.
func (*Init) Start ¶
Start starts the init process.
func (*Init) Stats ¶
func (*Init) Status ¶
Status returns the status of the process.
func (*Init) Stdin ¶
Stdin returns the stdin of the process.
func (*Init) Stdio ¶
Stdio returns the stdio of the process.
func (*Init) Wait ¶
func (p *Init) Wait()
Wait waits for the process to exit.
type Mount ¶
Mount holds filesystem mount configuration.
type ProcessMonitor ¶
type ProcessMonitor interface { // Subscribe to process exit changes Subscribe() chan runc.Exit // Unsubscribe to process exit changes Unsubscribe(c chan runc.Exit) }
ProcessMonitor monitors process exit changes.
Source Files ¶
deleted_state.go exec.go exec_state.go init.go init_state.go io.go proc.go types.go utils.go
- Version
- v0.0.0-20250605235530-a6711d1e1dc6 (latest)
- Published
- Jun 5, 2025
- Platform
- linux/amd64
- Imports
- 24 packages
- Last checked
- 4 hours ago –
Tools for package owners.