Skip to content

Commit

Permalink
kill all processes in container without private ps ns before destory
Browse files Browse the repository at this point in the history
Signed-off-by: lifubang <[email protected]>
  • Loading branch information
lifubang committed Oct 2, 2023
1 parent c30faf4 commit ee898ab
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 ee898ab

Please sign in to comment.