MCPcopy Create free account
hub / github.com/containerd/go-runc / command

Method command

command_linux.go:27–42  ·  view source on GitHub ↗
(context context.Context, args ...string)

Source from the content-addressed store, hash-verified

25)
26
27func (r *Runc) command(context context.Context, args ...string) *exec.Cmd {
28 command := r.Command
29 if command == "" {
30 command = DefaultCommand
31 }
32 cmd := exec.CommandContext(context, command, append(r.args(), args...)...)
33 cmd.SysProcAttr = &syscall.SysProcAttr{
34 Setpgid: r.Setpgid,
35 }
36 cmd.Env = filterEnv(os.Environ(), "NOTIFY_SOCKET") // NOTIFY_SOCKET introduces a special behavior in runc but should only be set if invoked from systemd
37 if r.PdeathSignal != 0 {
38 cmd.SysProcAttr.Pdeathsig = r.PdeathSignal
39 }
40
41 return cmd
42}
43
44func filterEnv(in []string, names ...string) []string {
45 out := make([]string, 0, len(in))

Callers 15

ListMethod · 0.95
StateMethod · 0.95
CreateMethod · 0.95
StartMethod · 0.95
ExecMethod · 0.95
RunMethod · 0.95
DeleteMethod · 0.95
KillMethod · 0.95
StatsMethod · 0.95
EventsMethod · 0.95
PauseMethod · 0.95
ResumeMethod · 0.95

Calls 2

argsMethod · 0.95
filterEnvFunction · 0.85

Tested by

no test coverage detected