Skip to content
This repository was archived by the owner on Feb 1, 2020. It is now read-only.

Commit eb86eb5

Browse files
fvoznikashentubot
authored andcommitted
Remove detach for exec options
Detachable exec commands are handled in the client entirely and the detach option is not used anymore. PiperOrigin-RevId: 195181272 Change-Id: I6e82a2876d2c173709c099be59670f71702e5bf0 Upstream-commit: a61def1
1 parent 16837a1 commit eb86eb5

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

pkg/sentry/control/proc.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ type ExecArgs struct {
7272
// Capabilities is the list of capabilities to give to the process.
7373
Capabilities *auth.TaskCapabilities
7474

75-
// Detach indicates whether Exec should detach once the process starts.
76-
Detach bool
77-
7875
// FilePayload determines the files to give to the new process.
7976
urpc.FilePayload
8077
}
@@ -135,12 +132,6 @@ func (proc *Proc) Exec(args *ExecArgs, waitStatus *uint32) error {
135132
return err
136133
}
137134

138-
// If we're supposed to detach, don't wait for the process to exit.
139-
if args.Detach {
140-
*waitStatus = 0
141-
return nil
142-
}
143-
144135
// Wait for completion.
145136
newTG.WaitExited()
146137
*waitStatus = newTG.ExitStatus().Status()

runsc/cmd/exec.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ func (ex *Exec) Execute(_ context.Context, f *flag.FlagSet, args ...interface{})
9999
if err != nil {
100100
Fatalf("error parsing process spec: %v", err)
101101
}
102-
e.Detach = ex.detach
103102
conf := args[0].(*boot.Config)
104103
waitStatus := args[1].(*syscall.WaitStatus)
105104

@@ -123,7 +122,7 @@ func (ex *Exec) Execute(_ context.Context, f *flag.FlagSet, args ...interface{})
123122
// executed. If detach was specified, starts a child in non-detach mode,
124123
// write the child's PID to the pid file. So when the container returns, the
125124
// child process will also return and signal containerd.
126-
if e.Detach {
125+
if ex.detach {
127126
binPath, err := specutils.BinPath()
128127
if err != nil {
129128
Fatalf("error getting bin path: %v", err)

0 commit comments

Comments
 (0)