We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents dc9be6c + 98d6350 commit face64aCopy full SHA for face64a
exec.go
@@ -9,6 +9,7 @@ import (
9
"strconv"
10
"strings"
11
12
+ "github.com/opencontainers/runc/libcontainer"
13
"github.com/opencontainers/runc/libcontainer/utils"
14
"github.com/opencontainers/runtime-spec/specs-go"
15
"github.com/urfave/cli"
@@ -101,6 +102,13 @@ func execProcess(context *cli.Context) (int, error) {
101
102
if err != nil {
103
return -1, err
104
}
105
+ status, err := container.Status()
106
+ if err != nil {
107
+ return -1, err
108
+ }
109
+ if status == libcontainer.Stopped {
110
+ return -1, fmt.Errorf("cannot exec a container that has run and stopped")
111
112
path := context.String("process")
113
if path == "" && len(context.Args()) == 1 {
114
return -1, fmt.Errorf("process args cannot be empty")
0 commit comments