mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Shutdown instead of terminate process on Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
This commit is contained in:
parent
06e92cc2c1
commit
8b50324273
1 changed files with 7 additions and 5 deletions
|
@ -15,7 +15,7 @@ import (
|
||||||
"github.com/Microsoft/hcsshim"
|
"github.com/Microsoft/hcsshim"
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
"github.com/docker/docker/pkg/sysinfo"
|
"github.com/docker/docker/pkg/sysinfo"
|
||||||
"github.com/opencontainers/runtime-spec/specs-go"
|
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||||
)
|
)
|
||||||
|
|
||||||
type client struct {
|
type client struct {
|
||||||
|
@ -396,10 +396,12 @@ func (clnt *client) Signal(containerID string, sig int) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Terminate Process
|
// Shut down the container
|
||||||
if err := cont.hcsProcess.Kill(); err != nil && !hcsshim.IsAlreadyStopped(err) {
|
if err := cont.hcsContainer.Shutdown(); err != nil {
|
||||||
// ignore errors
|
if !hcsshim.IsPending(err) && !hcsshim.IsAlreadyStopped(err) {
|
||||||
logrus.Warnf("libcontainerd: failed to terminate pid %d in %s: %q", cont.systemPid, containerID, err)
|
// ignore errors
|
||||||
|
logrus.Warnf("libcontainerd: failed to shutdown container %s: %q", containerID, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue