Skip to content

Commit

Permalink
kill all processes in the container with shared/hosted PID Ns before …
Browse files Browse the repository at this point in the history
…destory

Signed-off-by: lifubang <lifubang@acmcoder.com>
  • Loading branch information
lifubang committed Oct 2, 2023
1 parent 3ffcce8 commit f5e1a7d
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 f5e1a7d

Please sign in to comment.