Skip to content

Commit

Permalink
kill all processes in container with shared PID Ns before destory
Browse files Browse the repository at this point in the history
Signed-off-by: lifubang <lifubang@acmcoder.com>
  • Loading branch information
lifubang committed Oct 2, 2023
1 parent ccfd894 commit e17f88c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libcontainer/state_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ type containerState interface {
}

func destroy(c *Container) error {
if !c.config.Namespaces.IsPrivate(configs.NEWPID) && c.cgroupManager.Exists() {
if err := signalAllProcesses(c.cgroupManager, unix.SIGKILL); err != nil {
return err
}
}
err := c.cgroupManager.Destroy()
if c.intelRdtManager != nil {
if ierr := c.intelRdtManager.Destroy(); err == nil {
Expand Down

0 comments on commit e17f88c

Please sign in to comment.