Add --pid-file to ctr
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -85,6 +85,10 @@ var ContainerFlags = []cli.Flag{
|
||||
Name: "with-ns",
|
||||
Usage: "specify existing Linux namespaces to join at container runtime (format '<nstype>:<path>')",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "pid-file",
|
||||
Usage: "file path to write the task's pid",
|
||||
},
|
||||
}
|
||||
|
||||
func loadSpec(path string, s *specs.Spec) error {
|
||||
@@ -211,6 +215,11 @@ var Command = cli.Command{
|
||||
return err
|
||||
}
|
||||
}
|
||||
if context.IsSet("pid-file") {
|
||||
if err := commands.WritePidFile(context.String("pid-file"), int(task.Pid())); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
var con console.Console
|
||||
if tty {
|
||||
con = console.Current()
|
||||
|
Reference in New Issue
Block a user