summaryrefslogtreecommitdiffhomepage
path: root/pkg/v1/proc/exec.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/v1/proc/exec.go')
-rw-r--r--pkg/v1/proc/exec.go37
1 files changed, 36 insertions, 1 deletions
diff --git a/pkg/v1/proc/exec.go b/pkg/v1/proc/exec.go
index f4f9f46e2..f02b73bb2 100644
--- a/pkg/v1/proc/exec.go
+++ b/pkg/v1/proc/exec.go
@@ -42,7 +42,7 @@ import (
type execProcess struct {
wg sync.WaitGroup
- proc.State
+ execState execState
mu sync.Mutex
id string
@@ -88,6 +88,13 @@ func (e *execProcess) ExitedAt() time.Time {
return e.exited
}
+func (e *execProcess) SetExited(status int) {
+ e.mu.Lock()
+ defer e.mu.Unlock()
+
+ e.execState.SetExited(status)
+}
+
func (e *execProcess) setExited(status int) {
e.status = status
e.exited = time.Now()
@@ -95,6 +102,13 @@ func (e *execProcess) setExited(status int) {
close(e.waitBlock)
}
+func (e *execProcess) Delete(ctx context.Context) error {
+ e.mu.Lock()
+ defer e.mu.Unlock()
+
+ return e.execState.Delete(ctx)
+}
+
func (e *execProcess) delete(ctx context.Context) error {
e.wg.Wait()
if e.io != nil {
@@ -112,6 +126,13 @@ func (e *execProcess) delete(ctx context.Context) error {
return nil
}
+func (e *execProcess) Resize(ws console.WinSize) error {
+ e.mu.Lock()
+ defer e.mu.Unlock()
+
+ return e.execState.Resize(ws)
+}
+
func (e *execProcess) resize(ws console.WinSize) error {
if e.console == nil {
return nil
@@ -119,6 +140,13 @@ func (e *execProcess) resize(ws console.WinSize) error {
return e.console.Resize(ws)
}
+func (e *execProcess) Kill(ctx context.Context, sig uint32, _ bool) error {
+ e.mu.Lock()
+ defer e.mu.Unlock()
+
+ return e.execState.Kill(ctx, sig, false)
+}
+
func (e *execProcess) kill(ctx context.Context, sig uint32, _ bool) error {
internalPid := e.internalPid
if internalPid != 0 {
@@ -141,6 +169,13 @@ func (e *execProcess) Stdio() proc.Stdio {
return e.stdio
}
+func (e *execProcess) Start(ctx context.Context) error {
+ e.mu.Lock()
+ defer e.mu.Unlock()
+
+ return e.execState.Start(ctx)
+}
+
func (e *execProcess) start(ctx context.Context) (err error) {
var (
socket *runc.Socket