Merge pull request #1308 from giuseppe/fix-systemd-notify

fix systemd-notify when using a different PID namespace
This commit is contained in:
Mrunal Patel
2017-02-24 11:05:21 -08:00
committed by GitHub
5 changed files with 160 additions and 25 deletions
+9 -5
View File
@@ -165,7 +165,14 @@ func restoreContainer(context *cli.Context, spec *specs.Spec, config *configs.Co
if err != nil {
return -1, err
}
handler := newSignalHandler(!context.Bool("no-subreaper"))
notifySocket := newNotifySocket(context, os.Getenv("NOTIFY_SOCKET"), id)
if notifySocket != nil {
notifySocket.setupSpec(context, spec)
notifySocket.setupSocket()
}
handler := newSignalHandler(!context.Bool("no-subreaper"), notifySocket)
if err := container.Restore(process, options); err != nil {
return -1, err
}
@@ -181,10 +188,7 @@ func restoreContainer(context *cli.Context, spec *specs.Spec, config *configs.Co
return -1, err
}
}
if detach {
return 0, nil
}
return handler.forward(process, tty)
return handler.forward(process, tty, detach)
}
func criuOptions(context *cli.Context) *libcontainer.CriuOpts {